Waybar : Add Sway scratchpad toggle and killall.
This commit is contained in:
parent
e7cf18c97d
commit
8970341205
10
module/common/bash/module/Sway.nix
Normal file
10
module/common/bash/module/Sway.nix
Normal 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
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
|
@ -31,7 +31,9 @@
|
||||||
"show-empty": false,
|
"show-empty": false,
|
||||||
"format-icons": ["", ""],
|
"format-icons": ["", ""],
|
||||||
"tooltip": true,
|
"tooltip": true,
|
||||||
"tooltip-format": "{app}: {title}"
|
"tooltip-format": "{app}: {title}",
|
||||||
|
"on-click": "swaymsg 'scratchpad show'",
|
||||||
|
"on-click-right": "sway_scratchpad_kill"
|
||||||
},
|
},
|
||||||
"tray": {
|
"tray": {
|
||||||
// "icon-size": 21,
|
// "icon-size": 21,
|
||||||
|
|
Loading…
Reference in a new issue