diff options
| -rwxr-xr-x | ar/.local/bin/displayselect | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ar/.local/bin/displayselect b/ar/.local/bin/displayselect index 38fc942..e8e9dbf 100755 --- a/ar/.local/bin/displayselect +++ b/ar/.local/bin/displayselect @@ -6,6 +6,7 @@ twoscreen() { # If multi-monitor is selected and there are two screens. mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?") + [ -z "$mirror" ] && exit # Mirror displays using native resolution of external display and a scaled # version for the internal display if [ "$mirror" = "yes" ]; then @@ -30,6 +31,7 @@ twoscreen() { # If multi-monitor is selected and there are two screens. --scale "$scale_x"x"$scale_y" else primary=$(echo "$screens" | dmenu -i -p "Select primary display:") + [ -z "$primary" ] && exit secondary=$(echo "$screens" | grep -v ^"$primary"$) direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0 @@ -38,6 +40,7 @@ twoscreen() { # If multi-monitor is selected and there are two screens. morescreen() { # If multi-monitor is selected and there are more than two screens. primary=$(echo "$screens" | dmenu -i -p "Select primary display:") + [ -z "$primary" ] && exit secondary=$(echo "$screens" | grep -v ^"$primary"$ | dmenu -i -p "Select secondary display:") direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") tertiary=$(echo "$screens" | grep -v ^"$primary"$ | grep -v ^"$secondary"$ | dmenu -i -p "Select third display:") |
