all in case statement
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user