diff --git a/.i3blocks/dunst b/.i3blocks/dunst new file mode 100755 index 0000000..fa291fb --- /dev/null +++ b/.i3blocks/dunst @@ -0,0 +1,27 @@ +#!/bin/bash + +runtime="${XDG_RUNTIME_DIR}/i3blocks" +[[ ! -d "$runtime" ]] && mkdir -p "$runtime" + +if [[ -n "$button" ]] +then + pid=$(systemctl --user show -p MainPID --value dunst.service) + if [[ -f "$runtime/dunst" ]] + then + killall -SIGUSR2 $pid + rm "$runtime/dunst" + else + killall -SIGUSR1 $pid + touch "$runtime/dunst" + fi +fi + +echo -n "dunst " + +if [[ -f "$runtime/dunst" ]] +then + echo "" +else + echo "" +fi +