MCPcopy Index your code
hub / github.com/crabvk/bar-gmail

github.com/crabvk/bar-gmail @1.0.6

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.6 ↗ · + Follow
30 symbols 98 edges 4 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Bar Gmail

preview

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

Requirements

  • Font Awesome: default badge 
  • Libcanberra: notification sound (optional).

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

Installation

Use one of the following methods.

AUR package on ArchLinux and derivatives

https://aur.archlinux.org/packages/bar-gmail/

With pip from pypi.org

pip install --user bar-gmail
~/.local/bin/bar-gmail

Depending on your system you may also need to add the --break-system-packages flag.

With pip from git repo

git clone https://github.com/crabvk/bar-gmail.git
cd bar-gmail
git describe --abbrev=0 --tags # Get latest tag.
git checkoug LATEST_TAG
pip install -e .
~/.local/bin/bar-gmail

Usage

First, you need to authenticate the client:

bar-gmail auth

Then just run bar-gmail or bar-gmail --format polybar periodically to get unread messages count and new message notifications.

Credentials and session are stored in ~/.cache/bar-gmail.

Waybar config example

~/.config/waybar/config

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

"custom/gmail": {
    "exec": "bar-gmail",
    "return-type": "json",
    "interval": 10,
    "tooltip": false,
    "on-click": "xdg-open https://mail.google.com/mail/u/0/#inbox"
}

~/.config/waybar/style.css

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

Polybar config example

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

Script arguments

See bar-gmail --help for the full list of available subcommands and command arguments.

Possible values for -s, --sound is obtained with:

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

for example bar-gmail --sound message-new-instant.

If you have several mails you can specify the credentials.json file with the --credentials <path> flag.

Core symbols most depended-on inside this repo

_print
called by 4
bar_gmail/printer.py
print
called by 2
bar_gmail/printer.py
error
called by 2
bar_gmail/printer.py
cli
called by 1
bar_gmail/__init__.py
_is_innacurate
called by 1
bar_gmail/app.py
_play_sound
called by 1
bar_gmail/app.py
_send_notifications
called by 1
bar_gmail/app.py
run
called by 1
bar_gmail/app.py

Shape

Method 23
Class 6
Function 1

Languages

Python100%

Modules by API surface

bar_gmail/gmail.py12 symbols
bar_gmail/printer.py10 symbols
bar_gmail/app.py7 symbols
bar_gmail/__init__.py1 symbols

For agents

$ claude mcp add bar-gmail \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact