Waybar : Add Sway scratchpad toggle and killall.

This commit is contained in:
Dmitry Voronin 2024-05-04 17:47:44 +03:00
parent e7cf18c97d
commit 8970341205
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 13 additions and 1 deletions

View file

@ -0,0 +1,10 @@
{ ... }: {
text = ''
# Kill all windows in Sway scratchpad.
function sway_scratchpad_kill() {
for window in $(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?) | select(.name == "__i3_scratch").floating_nodes[].id'); do
swaymsg [ con_id="$window" ] kill
done
}
'';
}

View file

@ -31,7 +31,9 @@
"show-empty": false,
"format-icons": ["", ""],
"tooltip": true,
"tooltip-format": "{app}: {title}"
"tooltip-format": "{app}: {title}",
"on-click": "swaymsg 'scratchpad show'",
"on-click-right": "sway_scratchpad_kill"
},
"tray": {
// "icon-size": 21,