From 85d2107c5c30d86a7f68bfe73b0036b398838a99 Mon Sep 17 00:00:00 2001 From: Breizh Date: Wed, 29 Jul 2020 10:23:51 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Utilisation=20de=20dunstctl=20plut=C3=B4t?= =?UTF-8?q?=20que=20de=20kill=20et=20d'un=20fichier=20t=C3=A9moin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .i3blocks/dunst | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.i3blocks/dunst b/.i3blocks/dunst index e638c02..22dc477 100755 --- a/.i3blocks/dunst +++ b/.i3blocks/dunst @@ -1,28 +1,17 @@ #!/bin/bash -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 - kill -SIGUSR2 $pid - rm "$runtime/dunst" - else - kill -SIGUSR1 $pid - touch "$runtime/dunst" - fi -fi - -echo -n "dunst " - if [[ "$active" == "active" ]] then - if [[ -f "$runtime/dunst" ]] + if [[ -n "$button" ]] + then + dunstctl set-paused toggle + fi + + echo -n "dunst " + + if [[ "$(dunstctl is-paused)" == "true" ]] then echo "" else From 3a018048e5f0631bb93b1e2121c415bdaccf7977 Mon Sep 17 00:00:00 2001 From: Breizh Date: Wed, 29 Jul 2020 10:26:35 +0200 Subject: [PATCH 2/2] Correction du script dunst --- .i3blocks/dunst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.i3blocks/dunst b/.i3blocks/dunst index 22dc477..0f18783 100755 --- a/.i3blocks/dunst +++ b/.i3blocks/dunst @@ -2,6 +2,8 @@ active=$(systemctl --user show -p ActiveState --value dunst.service) +echo -n "dunst " + if [[ "$active" == "active" ]] then if [[ -n "$button" ]] @@ -9,8 +11,6 @@ then dunstctl set-paused toggle fi - echo -n "dunst " - if [[ "$(dunstctl is-paused)" == "true" ]] then echo ""