diff --git a/README.md b/README.md index 7d76da5..4b9c9e3 100644 --- a/README.md +++ b/README.md @@ -1169,7 +1169,7 @@ include /etc/sway/config.d/* [monitors] command=my-i3b-monitors - interval=-1 + interval=5 [volume] markup=pango @@ -1365,7 +1365,8 @@ include /etc/sway/config.d/* *) ;; esac - echo "🖥️" + l=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') + for i in `seq $l`; do echo -n "🖥️";done ``` 9. ~/bin/sway/my-i3b-temperature @@ -1531,7 +1532,7 @@ Just a gathering place of locky/suspendy type things… #!/usr/bin/bash # Maintained in linux-config.org lock() { - exec swaylock -i ~/Pictures/LockScreen/lock -c 000000 + swaylock -i ~/Pictures/LockScreen/lock -c 000000 & } lock_gpg_clear() { @@ -1650,12 +1651,12 @@ swaymsg "output ${m} ${1:-enable}" ```bash #!/usr/bin/bash # Maintained in linux-config.org +numActive=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') +[ "$numActive" = "1" ] && sway-notify "Only one active monitor so no...." && exit 1 s=$(swaymsg -t get_outputs | jq -r '.[] | "\(.name)\n\(.active)"' | zenity --title "Select Display" --list --text "" --column "Monitor" --column "Enabled") if [ ! -z "$s" ]; then e="$(zenity --list --title "Enable ${s}?" --text "" --radiolist --column "Pick" --column "Enabled" TRUE enable FALSE disable)" if [ ! -z "$e" ]; then - numActive=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') - [ "$numActive" = "1" ] && [ "$e" = "disable" ] && sway-notify "Only one active monitor so no...." && exit 1 swaymsg "output $s $e" (sleep 0.5 && sway-notify "$s:$e") & fi diff --git a/directories/bin/sway/my-i3b-monitors b/directories/bin/sway/my-i3b-monitors index 8cb9bc7..e62336f 100755 --- a/directories/bin/sway/my-i3b-monitors +++ b/directories/bin/sway/my-i3b-monitors @@ -7,4 +7,5 @@ case $BLOCK_BUTTON in *) ;; esac -echo "🖥️" +l=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') +for i in `seq $l`; do echo -n "🖥️";done diff --git a/directories/bin/sway/sway-screen-menu b/directories/bin/sway/sway-screen-menu index 87974b7..7b756c0 100755 --- a/directories/bin/sway/sway-screen-menu +++ b/directories/bin/sway/sway-screen-menu @@ -1,11 +1,11 @@ #!/usr/bin/bash # Maintained in linux-config.org +numActive=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') +[ "$numActive" = "1" ] && sway-notify "Only one active monitor so no...." && exit 1 s=$(swaymsg -t get_outputs | jq -r '.[] | "\(.name)\n\(.active)"' | zenity --title "Select Display" --list --text "" --column "Monitor" --column "Enabled") if [ ! -z "$s" ]; then e="$(zenity --list --title "Enable ${s}?" --text "" --radiolist --column "Pick" --column "Enabled" TRUE enable FALSE disable)" if [ ! -z "$e" ]; then - numActive=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') - [ "$numActive" = "1" ] && [ "$e" = "disable" ] && sway-notify "Only one active monitor so no...." && exit 1 swaymsg "output $s $e" (sleep 0.5 && sway-notify "$s:$e") & fi diff --git a/dot-config/i3blocks/config b/dot-config/i3blocks/config index c178fc3..c50d0d9 100644 --- a/dot-config/i3blocks/config +++ b/dot-config/i3blocks/config @@ -51,7 +51,7 @@ interval=2 [monitors] command=my-i3b-monitors -interval=-1 +interval=5 [volume] markup=pango diff --git a/linux-config.org b/linux-config.org index 5661a28..cf39c1d 100644 --- a/linux-config.org +++ b/linux-config.org @@ -1660,7 +1660,7 @@ $XDG_DATA_HOME/dbus-1/services/org.freedesktop.Notifications.service [monitors] command=my-i3b-monitors - interval=-1 + interval=5 [volume] markup=pango @@ -1837,7 +1837,8 @@ return the brightness % ,*) ;; esac - echo "🖥️" + l=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') + for i in `seq $l`; do echo -n "🖥️";done #+end_src ***** ~/bin/sway/my-i3b-temperature #+begin_src bash :tangle "~/bin/sway/my-i3b-temperature" @@ -2090,12 +2091,12 @@ Just a gathering place of locky/suspendy type things... #+begin_src bash :tangle "~/bin/sway/sway-screen-menu" #!/usr/bin/bash # Maintained in linux-config.org + numActive=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') + [ "$numActive" = "1" ] && sway-notify "Only one active monitor so no...." && exit 1 s=$(swaymsg -t get_outputs | jq -r '.[] | "\(.name)\n\(.active)"' | zenity --title "Select Display" --list --text "" --column "Monitor" --column "Enabled") if [ ! -z "$s" ]; then e="$(zenity --list --title "Enable ${s}?" --text "" --radiolist --column "Pick" --column "Enabled" TRUE enable FALSE disable)" if [ ! -z "$e" ]; then - numActive=$(swaymsg -t get_outputs | jq -r '[ .[] | select(.dpms and .active) ] | length') - [ "$numActive" = "1" ] && [ "$e" = "disable" ] && sway-notify "Only one active monitor so no...." && exit 1 swaymsg "output $s $e" (sleep 0.5 && sway-notify "$s:$e") & fi