aboutsummaryrefslogtreecommitdiff
path: root/.config/eww/scripts/scratchpad-indicator.sh
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2024-05-10 19:49:57 +0100
committerJustine Smithies <justine@smithies.me.uk>2024-05-10 19:49:57 +0100
commitccb081f4f40f71e5db09be082e69af9e25e84e41 (patch)
tree629268600e4eaad968886fc29f6dc012a68a210d /.config/eww/scripts/scratchpad-indicator.sh
parentfb3afe0023747f7f7f8f85dfa0a38baf61cbfb71 (diff)
Updates for using eww as the bar for sway
Diffstat (limited to '.config/eww/scripts/scratchpad-indicator.sh')
-rwxr-xr-x.config/eww/scripts/scratchpad-indicator.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/.config/eww/scripts/scratchpad-indicator.sh b/.config/eww/scripts/scratchpad-indicator.sh
index b0911d9..8fd06f4 100755
--- a/.config/eww/scripts/scratchpad-indicator.sh
+++ b/.config/eww/scripts/scratchpad-indicator.sh
@@ -1,9 +1,8 @@
#!/bin/bash
-# Scratchpad indicator for Hyprland
+# Scratchpad indicator for Sway
-output="$(hyprctl clients -j | jq -r '.[] | select(.workspace.id==-99) |"<b>"+.class+"</b> : <i>"+.title+"</i>"')"
-number="$(hyprctl clients -j | jq -r '.[] | select(.workspace.id==-99) | (tostring)' | wc -l)"
-file=~/.config/eww/eww.scss
+output="$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?)|recurse(.floating_nodes[]?)|select(.name == "__i3_scratch").floating_nodes[]|"`<b>"+.name+"`</b> - "+.app_id+" "+(.id|tostring)')"
+number="$(swaymsg -r -t get_tree | jq -r 'recurse(.nodes[]) | first(select(.name=="__i3_scratch")) | .floating_nodes | length')"
if [ "$number" -gt 0 ]; then
text=" $number"
@@ -21,7 +20,7 @@ function ShowInfo() {
exit
else
tooltip="$(echo -e $tooltip)"
- notify-send " Scratchpad" "$tooltip" -r 123
+ notify-send --hint=string:x-canonical-private-synchronous:scratchpad -u normal " Scratchpad" "$tooltip"
fi
}