From 798917e6983e15698ecabff0f255c6cbd6a46e54 Mon Sep 17 00:00:00 2001 From: Breizh Date: Wed, 29 Jul 2020 10:23:51 +0200 Subject: [PATCH] =?UTF-8?q?Utilisation=20de=20dunstctl=20plut=C3=B4t=20que?= =?UTF-8?q?=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