summaryrefslogtreecommitdiffstats
path: root/.local/bin/toggle_notifications.sh
diff options
context:
space:
mode:
authorYigit Sever2021-10-25 13:34:42 +0300
committerYigit Sever2021-10-25 13:34:42 +0300
commit06c6f71a6bdad88fc40219a8dd086acd052958e1 (patch)
treefb31036d2084355001a26cd4b25ac707907b32d6 /.local/bin/toggle_notifications.sh
parent328b9457389bda7c54138db6e908de1c6e1acc3f (diff)
parent3fad12478ae35265aac6496f61342471da06c4a9 (diff)
downloaddotfiles-06c6f71a6bdad88fc40219a8dd086acd052958e1.tar.gz
dotfiles-06c6f71a6bdad88fc40219a8dd086acd052958e1.tar.bz2
dotfiles-06c6f71a6bdad88fc40219a8dd086acd052958e1.zip
Merge remote-tracking branch 'origin'
Diffstat (limited to '.local/bin/toggle_notifications.sh')
-rwxr-xr-x.local/bin/toggle_notifications.sh16
1 files changed, 6 insertions, 10 deletions
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 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2 2
3TOGGLE=$HOME/.local/share/.pause_notifications 3if $(dunstctl is-paused); then
4
5if [ ! -e $TOGGLE ]; then
6 touch $TOGGLE
7 dunstify --appname="notifications" --icon="chronometer-pause" "pausing" -u low
8 sleep 3
9 killall -SIGUSR1 dunst # pause
10else
11 rm $TOGGLE
12 killall -SIGUSR2 dunst # resume
13 dunstify --appname="notifications" --icon="chronometer-start" "here's what happened" -u low 4 dunstify --appname="notifications" --icon="chronometer-start" "here's what happened" -u low
5 dunstctl set-paused false
6else
7 dunstify --appname="notifications" --icon="chronometer-pause" "pausing" -u low
8 sleep 2
9 dunstctl set-paused true
14fi 10fi