From 9697b41a458c07f41d923b32d959e73a109dfee6 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Sun, 24 Oct 2021 15:00:22 +0300 Subject: scripts: use new dunst interface to pause --- .local/bin/toggle_notifications.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to '.local/bin/toggle_notifications.sh') diff --git a/.local/bin/toggle_notifications.sh b/.local/bin/toggle_notifications.sh index 9b700b5..6818728 100755 --- a/.local/bin/toggle_notifications.sh +++ b/.local/bin/toggle_notifications.sh @@ -1,14 +1,10 @@ #!/usr/bin/env bash -TOGGLE=$HOME/.local/share/.pause_notifications - -if [ ! -e $TOGGLE ]; then - touch $TOGGLE - dunstify --appname="notifications" --icon="chronometer-pause" "pausing" -u low - sleep 3 - killall -SIGUSR1 dunst # pause -else - rm $TOGGLE - killall -SIGUSR2 dunst # resume +if $(dunstctl is-paused); then dunstify --appname="notifications" --icon="chronometer-start" "here's what happened" -u low + dunstctl set-paused false +else + dunstify --appname="notifications" --icon="chronometer-pause" "pausing" -u low + sleep 2 + dunstctl set-paused true fi -- cgit v1.2.3-70-g09d2