mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-04-19 09:42:27 +00:00
Use full if for more involved logic
This commit is contained in:
parent
7e111fd566
commit
977eb985fc
1 changed files with 12 additions and 9 deletions
|
@ -68,9 +68,10 @@ allposs=$(xrandr -q | grep "connected")
|
||||||
screens=$(echo "$allposs" | awk '/ connected/ {print $1}')
|
screens=$(echo "$allposs" | awk '/ connected/ {print $1}')
|
||||||
|
|
||||||
# If there's only one screen
|
# If there's only one screen
|
||||||
[ "$(echo "$screens" | wc -l)" -lt 2 ] &&
|
if [ "$(echo "$screens" | wc -l)" -lt 2 ]; then
|
||||||
{ onescreen "$screens"; postrun; notify-send "💻 Only one screen detected." "Using it in its optimal settings..."; exit ;}
|
onescreen "$screens"
|
||||||
|
notify-send "💻 Only one screen detected." "Using it in its optimal settings..."
|
||||||
|
else
|
||||||
# Get user choice including multi-monitor and manual selection:
|
# Get user choice including multi-monitor and manual selection:
|
||||||
chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") &&
|
chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") &&
|
||||||
case "$chosen" in
|
case "$chosen" in
|
||||||
|
@ -78,5 +79,7 @@ case "$chosen" in
|
||||||
"multi-monitor") multimon ;;
|
"multi-monitor") multimon ;;
|
||||||
*) onescreen "$chosen" ;;
|
*) onescreen "$chosen" ;;
|
||||||
esac
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
postrun
|
postrun
|
||||||
|
|
Loading…
Add table
Reference in a new issue