From be0b2f3aef9619bc67f28d4bbb9a14adb952b38f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 24 Sep 2018 11:20:17 -0400 Subject: [PATCH] all in case statement --- .scripts/displayselect | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.scripts/displayselect b/.scripts/displayselect index 95a4dc6..179f374 100755 --- a/.scripts/displayselect +++ b/.scripts/displayselect @@ -5,7 +5,6 @@ # User may also select "manual selection" which opens arandr. # I plan on adding a routine from multi-monitor setups later. - twoscreen() { # If multi-monitor is selected and there are two screens. primary=$(echo "$screens" | dmenu -i -p "asdf") secondary=$(echo "$screens" | grep -v "$primary") @@ -23,6 +22,7 @@ morescreen() { # If multi-monitor is selected and there are more than two screen multimon() { # Multi-monitor handler. case "$(echo "$screens" | wc -l)" in + 1) xrandr $(echo "$allposs" | awk '{print "--output", $1, "--auto"}' | tr '\n' ' ') ;; 2) twoscreen ;; *) morescreen ;; esac ;} @@ -33,9 +33,6 @@ allposs=$(xrandr -q | grep "connected") # Get all connected screens. screens=$(echo "$allposs" | grep " connected" | awk '{print $1}') -# If only one screen, activate it and exit. -[ "$(echo "$screens" | wc -l)" -lt 2 ] && xrandr $(echo "$allposs" | awk '{print "--output", $1, "--auto"}' | tr '\n' ' ') || - # Get user choice including multi-monitor and manual selection: chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") && case "$chosen" in