summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYigit Sever2021-10-24 15:00:22 +0300
committerYigit Sever2021-10-24 15:00:22 +0300
commit9697b41a458c07f41d923b32d959e73a109dfee6 (patch)
tree5ecdff55d89cab8122dd73e09b9a930d285f7307
parent391ca33b25a4e1794b24fd821e02749ef0b5e61a (diff)
downloaddotfiles-9697b41a458c07f41d923b32d959e73a109dfee6.tar.gz
dotfiles-9697b41a458c07f41d923b32d959e73a109dfee6.tar.bz2
dotfiles-9697b41a458c07f41d923b32d959e73a109dfee6.zip
scripts: use new dunst interface to pause
-rwxr-xr-x.config/polybar/focus1
-rwxr-xr-x.config/polybar/notification_pause.sh4
-rwxr-xr-x.config/polybar/stop1
-rwxr-xr-x.local/bin/toggle_notifications.sh16
4 files changed, 7 insertions, 15 deletions
diff --git a/.config/polybar/focus b/.config/polybar/focus
index 42edffb..49d46d2 100755
--- a/.config/polybar/focus
+++ b/.config/polybar/focus
@@ -44,4 +44,3 @@ if ($task =~ m/^(.*)?\s(\d+\w+)$/g) {
44 print "$1 | $2"; 44 print "$1 | $2";
45 } 45 }
46} 46}
47# print $task;
diff --git a/.config/polybar/notification_pause.sh b/.config/polybar/notification_pause.sh
index 1df1bd6..9bf6724 100755
--- a/.config/polybar/notification_pause.sh
+++ b/.config/polybar/notification_pause.sh
@@ -1,8 +1,6 @@
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 echo 4 echo
7else 5else
8 printf "" 6 printf ""
diff --git a/.config/polybar/stop b/.config/polybar/stop
index 58f8741..1efd193 100755
--- a/.config/polybar/stop
+++ b/.config/polybar/stop
@@ -44,4 +44,3 @@ if ($task =~ m/^(\d+)(.*)$/g) {
44 exec(qq(dunstify --appname="task" --icon="kt-pause" "stopping" "$1")); 44 exec(qq(dunstify --appname="task" --icon="kt-pause" "stopping" "$1"));
45 } 45 }
46} 46}
47
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