-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dunst script to toggle notifs and show history
- Loading branch information
1 parent
724f11e
commit ae63d37
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env sh | ||
# | ||
# Saumon i3blocks scripts | ||
# dunst (toggle notifs and show previous ones) | ||
# | ||
|
||
if ! command -v dunstctl >/dev/null; then | ||
echo " !dep " | ||
exit 33 | ||
fi | ||
|
||
case $BLOCK_BUTTON in | ||
2) # middle click: show previous notification | ||
dunstctl history-pop | ||
;; | ||
3) # right click: toggle do not disturb | ||
dunstctl set-paused toggle | ||
;; | ||
esac | ||
|
||
if [ "$(dunstctl is-paused)" = "true" ]; then | ||
echo "<span color='#f44336'></span>" | ||
else | ||
echo "<span color='#dddddd'></span>" | ||
fi |