diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config index 28070ae..2a3fd8e 100644 --- a/polybar/.config/polybar/config +++ b/polybar/.config/polybar/config @@ -59,7 +59,7 @@ module-margin-left = 2 modules-left = workspaces sxhkdmode pomo modules-center = music date papersdue -modules-right = networkspeed weather archupdates cpu temp backlight volume battery +modules-right = networkspeed mail weather archupdates cpu temp backlight 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,15 @@ format-prefix = " " interval = 120 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)" +exec-if = [ "$(notmuch count tag:inbox and tag:unread)" -gt 0 ] +click-right = systemctl --user start mbsync.timer +click-left = systemctl --user stop mbsync.timer +interval = 300.0 +format-underline = ${colors.primary} + [module/weather] type = custom/script exec = $XDG_CONFIG_HOME/polybar/scripts/poly-weather '?format=%t+%C+(%p)'