aboutsummaryrefslogtreecommitdiff
path: root/.config/eww/scripts/scratchpad-indicator.sh
diff options
context:
space:
mode:
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
}