diff options
| author | Yigit Sever | 2021-10-24 15:00:22 +0300 |
|---|---|---|
| committer | Yigit Sever | 2021-10-24 15:00:22 +0300 |
| commit | 9697b41a458c07f41d923b32d959e73a109dfee6 (patch) | |
| tree | 5ecdff55d89cab8122dd73e09b9a930d285f7307 /.local/bin | |
| parent | 391ca33b25a4e1794b24fd821e02749ef0b5e61a (diff) | |
| download | dotfiles-9697b41a458c07f41d923b32d959e73a109dfee6.tar.gz dotfiles-9697b41a458c07f41d923b32d959e73a109dfee6.tar.bz2 dotfiles-9697b41a458c07f41d923b32d959e73a109dfee6.zip | |
scripts: use new dunst interface to pause
Diffstat (limited to '.local/bin')
| -rwxr-xr-x | .local/bin/toggle_notifications.sh | 16 |
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 | ||
| 3 | TOGGLE=$HOME/.local/share/.pause_notifications | 3 | if $(dunstctl is-paused); then |
| 4 | |||
| 5 | if [ ! -e $TOGGLE ]; then | ||
| 6 | touch $TOGGLE | ||
| 7 | dunstify --appname="notifications" --icon="chronometer-pause" "pausing" -u low | ||
| 8 | sleep 3 | ||
| 9 | killall -SIGUSR1 dunst # pause | ||
| 10 | else | ||
| 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 | ||
| 6 | else | ||
| 7 | dunstify --appname="notifications" --icon="chronometer-pause" "pausing" -u low | ||
| 8 | sleep 2 | ||
| 9 | dunstctl set-paused true | ||
| 14 | fi | 10 | fi |
