waybar: add Help module, run help overlay on demand

This commit is contained in:
Aleksey Samoilov 2024-01-28 17:19:15 +04:00
parent f487ab78fb
commit 12183033bf
3 changed files with 13 additions and 1 deletions

View file

@ -7,6 +7,7 @@
"modules-right": [ "modules-right": [
"tray", "tray",
"custom/playerctl", "custom/playerctl",
"custom/help",
"custom/wlsunset", "custom/wlsunset",
"idle_inhibitor", "idle_inhibitor",
"custom/dunst", "custom/dunst",
@ -72,6 +73,12 @@
"signal": 5 "signal": 5
}, },
"custom/help": {
"format": "",
"on-click": "/usr/share/sway/scripts/help.sh --toggle",
"tooltip": "false"
},
"custom/wlsunset": { "custom/wlsunset": {
"interval": "once", "interval": "once",
"tooltip": true, "tooltip": true,

View file

@ -70,6 +70,7 @@ window#waybar.hidden {
} }
#clock, #clock,
#custon-help,
#custom-playerctl, #custom-playerctl,
#custom-power, #custom-power,
#custom-wlsunset, #custom-wlsunset,
@ -111,6 +112,10 @@ window#waybar.hidden {
color: @pink; color: @pink;
} }
#custom-help {
color: @rosewater;
}
#custom-wlsunset { #custom-wlsunset {
color: @mauve; color: @mauve;
} }

View file

@ -10,6 +10,6 @@ if [ "$1" = "--toggle" ]; then
else else
pkill -f -${QUIT_SIGNAL} nwg-wrapper pkill -f -${QUIT_SIGNAL} nwg-wrapper
for output in $(swaymsg -t get_outputs --raw | jq -r '.[].name'); do for output in $(swaymsg -t get_outputs --raw | jq -r '.[].name'); do
nwg-wrapper -o "$output" -sv ${VISIBILITY_SIGNAL} -sq ${QUIT_SIGNAL} -s help.sh -p left -a end & nwg-wrapper -o "$output" -i -sv ${VISIBILITY_SIGNAL} -sq ${QUIT_SIGNAL} -s help.sh -p left -a end &
done done
fi fi