From 7613b136fa621d541a2c17e6ad0f4069ae6dde6b Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 13 Jun 2021 16:10:41 +0300 Subject: Added an applet that can toggle dunst --- .config/openbox/autostart | 2 ++ .gitignore | 1 + dunst-toggler-applet.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100755 dunst-toggler-applet.sh diff --git a/.config/openbox/autostart b/.config/openbox/autostart index 1115358..8223e19 100644 --- a/.config/openbox/autostart +++ b/.config/openbox/autostart @@ -28,3 +28,5 @@ gtk-launch nextcloud-desktop & gtk-launch rambox & gtk-launch electron-mail & /opt/Caprine.AppImage & + +~/dunst-toggler-applet.sh & diff --git a/.gitignore b/.gitignore index 31e0340..62aa296 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ !toggle_repo.sh !app-mem.sh !toggle-desktop.sh +!dunst-toggler-applet.sh !.local/ .local/* diff --git a/dunst-toggler-applet.sh b/dunst-toggler-applet.sh new file mode 100755 index 0000000..e9f253e --- /dev/null +++ b/dunst-toggler-applet.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +function update { + while :; do + curr_status=$(dunstctl is-paused) + + if [[ "$curr_status" != "$prev_status" ]]; then + prev_status=$curr_status + + if [[ "$curr_status" == "true" ]]; then + echo icon:/usr/share/icons/tabler-icon-bell-off.png + echo tooltip:Notifications OFF + else + echo icon:/usr/share/icons/tabler-icon-bell.png + echo tooltip:Notifications ON + fi + fi + + sleep 0.2 + done +} + +update | \ +yad --notification \ + --listen \ + --command="dunstctl set-paused toggle" -- cgit v1.2.3