/gmail

Gmail checker for Linux

Primary LanguageGoMIT LicenseMIT

Mail checker for unread messages

For i3status-rust

I use i3/Sway wm and want to have a notification for new emails in i3 status line.

Requirements

You need to create OAuth client ID credentials and

In order to create $XDG_CONFIG_HOME/mail/config.json file run these commands:

$ go build -o ./bin/mail ./cmd/main.go
$ bin/mail -add

Answering few questions this command will create sample config file with this content:

[
    {
        "client_id":     "<client_id>",
        "mail_type":     "gmail",
        "email":         "<email address>",
        "short":         "A",
    }
]

Just edit this file. You could use several gmail accounts to have a personal and work notifications. Before adding new account you need to have <client id>.json file, with your credentials and specify the path to this file during account creation. Unread count is available as dbus message.

Install

You need to have an installed go.

Just clone the repository and run

go build -o ./bin/mail ./cmd/main.go

Or use go-task for this

task build

You get binary file mail. You can put it to /usr/local/bin and run

You can use multiple accounts, just make sure $XDG_CONFIG_HOME/mail/config.json has valid json format