that's a bunch of cool new stuff
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
readonly ENABLED=''
|
||||
readonly DISABLED=''
|
||||
|
||||
dbus-monitor path='/org/freedesktop/Notifications',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged' --profile |
|
||||
while read -r _; do
|
||||
PAUSED="$(dunstctl is-paused)"
|
||||
if [ "$PAUSED" == 'false' ]; then
|
||||
CLASS="enabled"
|
||||
TEXT="$ENABLED"
|
||||
TOOLTIP="Notifications are on"
|
||||
else
|
||||
CLASS="disabled"
|
||||
TEXT="$DISABLED"
|
||||
TOOLTIP="Notifications are off"
|
||||
COUNT="$(dunstctl count waiting)"
|
||||
if [ "$COUNT" != '0' ]; then
|
||||
TEXT="$DISABLED ($COUNT)"
|
||||
fi
|
||||
fi
|
||||
printf '{"text": "%s", "class": "%s", "tooltip": "%s"}\n' "$TEXT" "$CLASS" "$TOOLTIP"
|
||||
done
|
||||
Reference in New Issue
Block a user