bar-protonmail

Get notifications and unread messages count from ProtonMail (Waybar/Polybar module)


Keywords
waybar, polybar, protonmail
License
MIT
Install
pip install bar-protonmail==1.2.0

Documentation

New message notifications and unread messages count from ProtonMail (Waybar/Polybar module)

Dependencies

  • proton-client >= 0.7.1 (not available on pypi.org)
  • ttf-font-awesome (default badge: )
  • libnotify (new email notifications, can be disabled with -dn flag)
  • libcanberra (optional, notification sound)

To display notifications you must have a notification daemon running on your system.

Install

ArchLinux and derivatives

AUR package

Other distros

git clone https://github.com/crabvk/bar-protonmail.git
# WARN: Checkout to the latest tag, don't use master branch.
pip install -e .

And now you can execute ~/.local/bin/bar-protonmail

Use

First, you need to authenticate the client:

bar-protonmail auth

then just run bar-protonmail or bar-protonmail -f polybar. Session, cache and log are stored in ~/.cache/bar-protonmail.

Waybar config example

~/.config/waybar/config

"modules-right": {
    "custom/protonmail"
}

"custom/protonmail": {
    "exec": "bar-protonmail",
    "return-type": "json",
    "interval": 10,
    "tooltip": false,
    "on-click": "xdg-open https://mail.proton.me/u/0/inbox"
}

~/.config/waybar/style.css

#custom-protonmail.unread {
    color: white;
}
#custom-protonmail.inaccurate {
    color: darkorange;
}
#custom-protonmail.error {
    color: darkred;
}

Polybar config example

modules-right = protonmail
...
[module/protonmail]
type = custom/script
exec = bar-protonmail -f polybar
interval = 10
click-left = xdg-open https://mail.proton.me/u/0/inbox

Script arguments

See bar-protonmail -h for the list of arguments with descriptions.
Possible values for -s, --sound can be found with:

ls /usr/share/sounds/freedesktop/stereo/ | cut -d. -f1

for example -s message-new-instant.