sxhkd, polybar, dunst: Add setting no disturb mode

By invoking key combination fn+F9 (XF86Search button), we can quiet
dunst notifications.

This change will be picked up by polybar and a small do not disturb
symbol is shown in the top bar (a tiny moon).

Both scripts are very simple and make use of a temporary file, so a
little brittle but workable.
This commit is contained in:
Marty Oehme 2021-03-17 14:46:39 +01:00
parent bab92816d0
commit a6b3a973bb
Signed by: Marty
GPG key ID: B7538B8F50A1C800
2 changed files with 11 additions and 1 deletions

View file

@ -59,7 +59,7 @@ module-margin-left = 2
modules-left = sxhkdmode workspaces pomo papersdue
modules-center = music date
modules-right = networkspeed mail weather archupdates cpu temp volume battery
modules-right = dunstpaused networkspeed mail weather archupdates cpu temp volume battery
; do not use offsets for the bar, would only work with override-redirect
; and will mess up tray https://github.com/polybar/polybar/issues/1355
tray-position = right
@ -250,6 +250,13 @@ format-prefix = " "
interval = 120
format-underline = ${colors.primary}
[module/dunstpaused]
type = custom/script
exec = sed -e 's/true/⏾/' -e 's/false//' /tmp/dunstpaused
exec-if = [ -f /tmp/dunstpaused ]
tail = true
format-underline = ${colors.primary}
[module/mail]
type = custom/script
exec = echo "$( [ $(systemctl --user --property=ActiveState show mbsync.timer) = 'ActiveState=active' ] && echo "" || echo "" ) $(notmuch count tag:inbox and tag:unread)"

View file

@ -25,6 +25,9 @@ XF86AudioMute
XF86Audio{LowerVolume,RaiseVolume}
control-volume {down, up}
XF86Search
dunstctl set-paused toggle && echo "$(dunstctl is-paused)" > /tmp/dunstpaused
# Open terminal emulator (the variable gets set in sh module basic env vars)
super + Return
$TERMINAL