Skip to main content

Show unread emails in INBOX using Gnome Online Accounts

Project description

mongars - count inbox emails

count inbox emails using Gnome Online Accounts

Description

mongars will take an email account as configured in Gnome Online account (only oauth based email account is supported) and will output how many unread emails you have in there.

You just need to specify the email to check as an argument i.e:

mongars john.snow@gmail.com

by default it will count the unread messages in the INBOX folder, if you woulld like to count another folder you can specify the -m option to it :

mongars -m Label1 john.snow@gmail.com

This currently only support oauth2 based accounts, imap account with username, password are not currently supported (patch welcome but you probably want to use something more secure).

I only tested it with Google/Gmail accounts (enteprise and personal) so let me know if it works or not on other oauth2 based email accounts.

Install

Arch

You can install this from aur with your aurhelper, like yay :

yay -S mongars

Manual

Checkout this repository, install poetry and run it with :

poetry run mongars

Running it without Gnome

If you run this outside of gnome environement (ie: from a windows manager), you have to configure the accounts first in Gnone Online Account settings from gnome and then you can use it from your windows manager.

From your window manager start scripts or somewhere else you need to make sure to run the goa-daemon, for example on arch the path is /usr/lib/goa-daemon and from your startup script you will do :

/usr/lib/goa-daemon --replace &

different distros may have a different path, see also this bugzilla bug #1340203)

Polybar

You can easily integrate this with Polybar :

[module/email]
type = custom/script
format-prefix = " "
exec = mongars email@gmail.com
format-prefix-foreground = #ffd700
interval = 5
click-left = xdg-open https://mail.google.com/

It will only shows up when you have emails.

Sames goes for the integration with other bars like waybar

License

Apache

Authors

© 2021 Chmouel Boudjnah (@chmouel) - https://chmouel.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mongars-0.1.3.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

mongars-0.1.3-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page