Metadata-Version: 2.1
Name: bar-gmail
Version: 1.0.0
Summary: Get notifications and unread messages count from Gmail (Waybar/Polybar module)
Home-page: https://github.com/crabvk/bar-gmail
License: MIT
Keywords: waybar,polybar,gmail
Author: Vyacheslav Konovalov
Author-email: crabvk@protonmail.com
Requires-Python: >=3.10.7,<4.0.0
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: google-api-python-client (>=2.100.0,<3.0.0)
Requires-Dist: google-auth-httplib2 (>=0.1.1,<0.2.0)
Requires-Dist: google-auth-oauthlib (>=1.1.0,<2.0.0)
Description-Content-Type: text/markdown

# Bar Gmail

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

![preview](https://github.com/crabvk/polybar-gmail/raw/master/preview.png)

## Dependencies

```sh
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
# or use poetry
```

**Font Awesome** - default email icon

**canberra-gtk-play** - new email sound notification

You can change the icon or turn off sound, for more info see [script arguments](#script-arguments)

## Installation

```sh
cd ~/.config/polybar
curl -LO https://github.com/crabvk/polybar-gmail/archive/master.tar.gz
tar zxf master.tar.gz && rm master.tar.gz
mv polybar-gmail-master gmail
```

and obtain/refresh credentials

```sh
~/.config/polybar/gmail/auth.py
```

### Module

```ini
[module/gmail]
type = custom/script
exec = ~/.config/polybar/gmail/launch.py
tail = true
click-left = xdg-open https://mail.google.com
```

## Script arguments

`-l` or `--label` - set user's mailbox [label](https://developers.google.com/gmail/api/v1/reference/users/labels/list), default: INBOX

`-p` or `--prefix` - set email icon, default: 

`-c` or `--color` - set new email icon color, default: #e06c75

`-ns` or `--nosound` - turn off new email sound

`-cr` or `--credentials` - path to your `credentials.json`, defaults to `credentials.json`

### Example

```sh
./launch.py --label 'CATEGORY_PERSONAL' --prefix '✉' --color '#be5046' --nosound
```

## Get list of all your mailbox labels

```python
./list_labels.py
```

