save last state
This commit is contained in:
18
scripts/bin/dunst.sh
Executable file
18
scripts/bin/dunst.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
readonly ENABLED=' '
|
||||
readonly DISABLED=' '
|
||||
readonly WAITING=' '
|
||||
|
||||
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
|
||||
TEXT="$ENABLED"
|
||||
else
|
||||
TEXT="$DISABLED"
|
||||
COUNT="$(dunstctl count waiting)"
|
||||
if [ "$COUNT" != '0' ]; then
|
||||
TEXT="$WAITING"
|
||||
fi
|
||||
fi
|
||||
printf "%s\n" "$TEXT"
|
||||
done
|
||||
Reference in New Issue
Block a user