From c8f20c6f440444a1312d059f2bdb71e99b15c26a Mon Sep 17 00:00:00 2001 From: Breizh Date: Mon, 24 Feb 2020 14:26:41 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'.i3blocks/dunst'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .i3blocks/dunst | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) mode change 100755 => 100644 .i3blocks/dunst diff --git a/.i3blocks/dunst b/.i3blocks/dunst old mode 100755 new mode 100644 index fa291fb..e638c02 --- a/.i3blocks/dunst +++ b/.i3blocks/dunst @@ -3,25 +3,31 @@ runtime="${XDG_RUNTIME_DIR}/i3blocks" [[ ! -d "$runtime" ]] && mkdir -p "$runtime" +active=$(systemctl --user show -p ActiveState --value dunst.service) + if [[ -n "$button" ]] then pid=$(systemctl --user show -p MainPID --value dunst.service) if [[ -f "$runtime/dunst" ]] then - killall -SIGUSR2 $pid + kill -SIGUSR2 $pid rm "$runtime/dunst" else - killall -SIGUSR1 $pid + kill -SIGUSR1 $pid touch "$runtime/dunst" fi fi echo -n "dunst " -if [[ -f "$runtime/dunst" ]] +if [[ "$active" == "active" ]] then - echo "" + if [[ -f "$runtime/dunst" ]] + then + echo "" + else + echo "" + fi else - echo "" + echo "" fi -