commit c3059679fbbc49e7860be0cc855800d5bbf8f78d parent 2c13e443cb363f9826d3cd14d73bc00377565742 Author: Michael Constantine Dimopoulos <anivsante2@gmail.com> Date: Sat, 16 Nov 2024 17:47:41 +0000 Add files via upload Diffstat:
| A | msc.sh | | | 25 | +++++++++++++++++++++++++ |
1 file changed, 25 insertions(+), 0 deletions(-)
diff --git a/msc.sh b/msc.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +primary="LVDS-1" + +dp=$(xrandr | grep " connected" | cut -d" " -f1 | grep -v $primary | dmenu -p "Monitor") + +res=$(xrandr | grep $dp -A 1 | tail -1 | tr -s " " | cut -d" " -f2) + +rot=$(printf "normal\nleft\nright\ninverted\ncancel" | dmenu -p "Rotation") +if [ "$rot" == "cancel" ]; then exit 0; fi + +rl=$(printf "normal\nright\nleft\nmirror\ncancel" | dmenu -p "Relation") +if [ "$rl" == "cancel" ]; then exit 0; fi + +if [ "$rl" == "normal" ]; then + xrandr --output $dp --mode "$res" --rotate $rot +elif [ "$rl" == "mirror" ]; then + #dp1=$(xrandr | grep " connected" | cut -d" " -f1 | dmenu | grep -v $dp) + #xrandr --output $dp --mode "$res" --rotate $rot --same-as $dp1 + xrandr --output $dp --mode "$res" --rotate $rot --same-as $primary +else + #dp1=$(xrandr | grep " connected" | cut -d" " -f1 | dmenu | grep -v $dp) + #xrandr --output $dp --mode "$res" --rotate $rot --"${rl}"-of $dp1 + xrandr --output $dp --mode "$res" --rotate $rot --"${rl}"-of $primary +fi