show a monitor icon for each monitor

This commit is contained in:
rileyrg 2021-05-24 00:55:10 +02:00
parent cec31f1b1f
commit ccf8400024
5 changed files with 16 additions and 13 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -51,7 +51,7 @@ interval=2
[monitors]
command=my-i3b-monitors
interval=-1
interval=5
[volume]
markup=pango

View file

@ -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