Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.3k stars 690 forks source link

add a maildir module #1013

Open mvdan opened 3 years ago

mvdan commented 3 years ago

Thanks for writing this sway bar! I just switched from i3status-rust, mainly because I wanted libappindicator-gtk3 support. It works great!

Porting my config was easy enough, minus one feature that I'm missing in waybar. i3status and i3status-rust have a maildir block/widget/module, which essentially counts unread mails in a list of MailDirs.

For example:

[[block]]
block = "maildir"
interval = 60
inboxes = ["/home/mvdan/mail/Inbox", "/home/mvdan/mail/Notifications"]
threshold_warning = 1
threshold_critical = 10
display_type = "new"

One can implement this in waybar with a custom module and command-line tools like find -type f <dir1>/new <dir2>/new ... | wc -l, but I argue that this is probably common enough to warrant being a proper built-in module. It would also be nice for it to support color thresholds, like i3status's. Similar to other widgets like battery, the UI should change color when there are unread emails.

fauxmight commented 1 year ago

Here's a fleshed out custom module that does the color changes for new mail (if you set up a "newmail" class in styles.css) AND generates a notification on newmail with notify-send:

waybar-maildir.sh