Files
dotfiles/.config/waybar/scripts/dunst.sh
T

18 lines
404 B
Bash
Raw Normal View History

2024-06-07 18:18:06 +05:30
#!/bin/bash
COUNT=$(dunstctl count waiting)
2024-07-20 18:03:39 +05:30
status=""
class=""
tooltip="Notifications are "
if dunstctl is-paused | grep -q "false" ; then
status="NOT"
tooltip+="active"
else
status="DND"
class="dnd"
tooltip+="paused"
fi
if [ $COUNT != 0 ]; then text+=":$COUNT"; fi
printf '{"text":"%s","tooltip":"%s","class":"%s"}' "$status" "$tooltip" "$class" | jq --unbuffered --compact-output