commit after getting everything working on desktop hyprland

This commit is contained in:
bullshar-k
2026-10-16 09:22:39 +00:00
parent 8cec28481a
commit b94a8b62a3
6 changed files with 151 additions and 24 deletions

View File

@@ -0,0 +1,21 @@
#!/bin/sh
# Waybar "custom/notifications" module (return-type: json).
# Counts active mako notifications and degrades gracefully when mako is absent.
count=0
if command -v makoctl >/dev/null 2>&1; then
count=$(makoctl list 2>/dev/null | grep -c '"id"')
fi
case "$count" in ''|*[!0-9]*) count=0 ;; esac
if [ "$count" -gt 0 ]; then
text=$(printf '\357\203\263 %s' "$count")
tooltip="$count notification(s)"
class=unread
else
text=$(printf '\357\203\263')
tooltip="No notifications"
class=empty
fi
printf '{"text":"%s","tooltip":"%s","class":"%s"}\n' "$text" "$tooltip" "$class"