bar-gmail


Namebar-gmail JSON
Version 1.0.5 PyPI version JSON
download
home_pagehttps://github.com/crabvk/bar-gmail
SummaryGet notifications and unread messages count from Gmail (Waybar/Polybar module)
upload_time2023-12-02 13:52:50
maintainer
docs_urlNone
authorVyacheslav Konovalov
requires_python>=3.10.7,<4.0.0
licenseMIT
keywords waybar polybar gmail
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Bar Gmail

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

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](https://wiki.archlinux.org/title/Desktop_notifications#Notification_servers) 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

```sh
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

```sh
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:

```sh
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*

```json
"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*

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

## Polybar config example

```ini
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:

```shell
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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/crabvk/bar-gmail",
    "name": "bar-gmail",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10.7,<4.0.0",
    "maintainer_email": "",
    "keywords": "waybar,polybar,gmail",
    "author": "Vyacheslav Konovalov",
    "author_email": "crabvk@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f4/94/00575a10ba370772a8715fb8634b7cfc633710f6f1a7c599040c85bb98d1/bar_gmail-1.0.5.tar.gz",
    "platform": null,
    "description": "# Bar Gmail\n\n![preview](https://github.com/crabvk/polybar-gmail/raw/master/preview.png)\n\nGet notifications and unread messages count from Gmail (Waybar/Polybar module).\n\n## Requirements\n\n* Font Awesome: default badge \uf0e0\n* Libcanberra: notification sound (optional).\n\nTo display notifications you must have a [notification daemon](https://wiki.archlinux.org/title/Desktop_notifications#Notification_servers) running on your system.\n\n## Installation\n\nUse one of the following methods.\n\n### AUR package on ArchLinux and derivatives\n\nhttps://aur.archlinux.org/packages/bar-gmail/\n\n### With pip from pypi.org\n\n```sh\npip install --user bar-gmail\n~/.local/bin/bar-gmail\n```\n\nDepending on your system you may also need to add the `--break-system-packages` flag.\n\n### With pip from git repo\n\n```sh\ngit clone https://github.com/crabvk/bar-gmail.git\ncd bar-gmail\ngit describe --abbrev=0 --tags # Get latest tag.\ngit checkoug LATEST_TAG\npip install -e .\n~/.local/bin/bar-gmail\n```\n\n## Usage\n\nFirst, you need to authenticate the client:\n\n```sh\nbar-gmail auth\n```\n\nThen just run `bar-gmail` or `bar-gmail --format polybar` periodically to get unread messages count and new message notifications.\n\nCredentials and session are stored in *~/.cache/bar-gmail*.\n\n## Waybar config example\n\n*~/.config/waybar/config*\n\n```json\n\"modules-right\": {\n    \"custom/gmail\"\n}\n\n\"custom/gmail\": {\n    \"exec\": \"bar-gmail\",\n    \"return-type\": \"json\",\n    \"interval\": 10,\n    \"tooltip\": false,\n    \"on-click\": \"xdg-open https://mail.google.com/mail/u/0/#inbox\"\n}\n```\n\n*~/.config/waybar/style.css*\n\n```css\n#custom-gmail.unread {\n    color: white;\n}\n#custom-gmail.inaccurate {\n    color: darkorange;\n}\n#custom-gmail.error {\n    color: darkred;\n}\n```\n\n## Polybar config example\n\n```ini\nmodules-right = gmail\n...\n[module/gmail]\ntype = custom/script\nexec = bar-gmail -f polybar\ninterval = 10\nclick-left = xdg-open https://mail.google.com/mail/u/0/#inbox\n```\n\n## Script arguments\n\nSee `bar-gmail --help` for the full list of available subcommands and command arguments.\n\nPossible values for `-s`, `--sound` is obtained with:\n\n```shell\nls /usr/share/sounds/freedesktop/stereo/ | cut -d. -f1\n```\n\nfor example `bar-gmail --sound message-new-instant`.\n\nIf you have several mails you can specify the `credentials.json` file with the `--credentials <path>` flag.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Get notifications and unread messages count from Gmail (Waybar/Polybar module)",
    "version": "1.0.5",
    "project_urls": {
        "Homepage": "https://github.com/crabvk/bar-gmail"
    },
    "split_keywords": [
        "waybar",
        "polybar",
        "gmail"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "083975a4a4478c9ae361a7ce11e2fbfa452a8365524f62d8bb00dbed9f6b033d",
                "md5": "5bb4111309589e110ff0ecee7a187ee8",
                "sha256": "aa71267145dc773125962d78e18e192452eeee0d7117d687dd836905165cb8ce"
            },
            "downloads": -1,
            "filename": "bar_gmail-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5bb4111309589e110ff0ecee7a187ee8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10.7,<4.0.0",
            "size": 9072,
            "upload_time": "2023-12-02T13:52:48",
            "upload_time_iso_8601": "2023-12-02T13:52:48.447979Z",
            "url": "https://files.pythonhosted.org/packages/08/39/75a4a4478c9ae361a7ce11e2fbfa452a8365524f62d8bb00dbed9f6b033d/bar_gmail-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f49400575a10ba370772a8715fb8634b7cfc633710f6f1a7c599040c85bb98d1",
                "md5": "4de5c985e0d7e98142c61beb52c07b9d",
                "sha256": "1b8c7e4c413d819ed570fd6ae161be8c9261eef90f0faac822a4fe235f9fa7ba"
            },
            "downloads": -1,
            "filename": "bar_gmail-1.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "4de5c985e0d7e98142c61beb52c07b9d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10.7,<4.0.0",
            "size": 7317,
            "upload_time": "2023-12-02T13:52:50",
            "upload_time_iso_8601": "2023-12-02T13:52:50.300461Z",
            "url": "https://files.pythonhosted.org/packages/f4/94/00575a10ba370772a8715fb8634b7cfc633710f6f1a7c599040c85bb98d1/bar_gmail-1.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-02 13:52:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "crabvk",
    "github_project": "bar-gmail",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bar-gmail"
}
        
Elapsed time: 0.14434s