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:
parent
bab92816d0
commit
a6b3a973bb
2 changed files with 11 additions and 1 deletions
|
@ -59,7 +59,7 @@ module-margin-left = 2
|
||||||
|
|
||||||
modules-left = sxhkdmode workspaces pomo papersdue
|
modules-left = sxhkdmode workspaces pomo papersdue
|
||||||
modules-center = music date
|
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
|
; 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
|
; and will mess up tray https://github.com/polybar/polybar/issues/1355
|
||||||
tray-position = right
|
tray-position = right
|
||||||
|
@ -250,6 +250,13 @@ format-prefix = " "
|
||||||
interval = 120
|
interval = 120
|
||||||
format-underline = ${colors.primary}
|
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]
|
[module/mail]
|
||||||
type = custom/script
|
type = custom/script
|
||||||
exec = echo "$( [ $(systemctl --user --property=ActiveState show mbsync.timer) = 'ActiveState=active' ] && echo "" || echo "" ) $(notmuch count tag:inbox and tag:unread)"
|
exec = echo "$( [ $(systemctl --user --property=ActiveState show mbsync.timer) = 'ActiveState=active' ] && echo "" || echo "" ) $(notmuch count tag:inbox and tag:unread)"
|
||||||
|
|
|
@ -25,6 +25,9 @@ XF86AudioMute
|
||||||
XF86Audio{LowerVolume,RaiseVolume}
|
XF86Audio{LowerVolume,RaiseVolume}
|
||||||
control-volume {down, up}
|
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)
|
# Open terminal emulator (the variable gets set in sh module basic env vars)
|
||||||
super + Return
|
super + Return
|
||||||
$TERMINAL
|
$TERMINAL
|
||||||
|
|
Loading…
Reference in a new issue