1
0
Fork 0
mirror of https://github.com/ItsDrike/dotfiles.git synced 2025-04-29 05:08:36 +00:00

Use full if for more involved logic

This commit is contained in:
ItsDrike 2022-08-13 13:45:46 +02:00
parent 7e111fd566
commit 977eb985fc
No known key found for this signature in database
GPG key ID: B014E761034AF742

View file

@ -68,15 +68,18 @@ 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..."
# Get user choice including multi-monitor and manual selection: else
chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") && # Get user choice including multi-monitor and manual selection:
case "$chosen" in chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") &&
case "$chosen" in
"manual selection") arandr ; exit ;; "manual selection") arandr ; exit ;;
"multi-monitor") multimon ;; "multi-monitor") multimon ;;
*) onescreen "$chosen" ;; *) onescreen "$chosen" ;;
esac esac
fi
postrun postrun