mmtools


Namemmtools JSON
Version 0.0.39 PyPI version JSON
download
home_pageNone
Summarymmtools
upload_time2024-09-10 16:04:01
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mmtools - i3 status bar and notification script for Mattermost

mmtools are various tools using the [mattermost](https://mattermost.org) API.

# Installation

```bash
sudo pip3 install mmtools
```

This will install mmtols from pypi, including the following required packages:

- caep
- pydantic
- mattermostdriver
- passpy
- notify2
- dbus-python
- requests

For dbus-python to build, you need to have the libdbus-1-dev package installed. On debian you can do

```bash
sudo apt install libdbus-1-dev
```

# Tools

The following tools are included:

### mmstatus

`mmstatus` connects to the mattermost API to get unread messages in all channels. It then outputs a statusbar (usable in i3blocks) of unread messages and exits. Supports private/public/user channels and different coloring on group chats and user chats.

Example configuration for i3blocks:

```
[mattermost]
command=/usr/local/bin/mmstatus
separator=true
interval=60
signal=12
```

### mmpolybar

`mmpolybar` same as mmstatus, but with polybar colors.

Example configuration for polybar:

```
[module/mmpolybar]
type = custom/script
exec = mmpolybar
tail = true
```

### mmwaybar

`mmwaybar` same as mmstatus, but with output for waybar.

Example configuration for waybar:

```
"custom/mattermost": {
    "exec": " mmwaybar",
    "return-type": "json",
    "interval": 90
}
```

### mmwatch

`mmwatch` connects to the mattermost websocket API and can display notification on messages and send SIGUSR2 to i3blocks to update statusbar before next interval.


## Configuration

All tools can be configured using both command line arguments and a configuration file.

`mmtools` will first look for a configuration in `~/.config/mmtools/config-<HOSTNAME>` with fallback to `~/.config/mmtools/config`.

Use the following command to create the configuration `~/.config/mmtools/config`. The same configuration file is used for both tools.

```bash
mmconfig init
```

In this file you must specify at least:

```
# Mattermost server
server = <SERVER>

# Mattermost user
user = <USERNAME>

# either password
password = <MATTERMOST PASSWORD>

# OR pass entry (https://www.passwordstore.org)
password-pass-entry = <PASS ENTRY>
```

## User service for `mmwatch`

`mmwatch` can be started as a systemd user service by creating the following file:

`.config/systemd/user/mmwatch.service`

with this content:

```
[Unit]
Description=mm watch

[Service]
ExecStart=/usr/local/bin/mmwatch

Restart=always

# time to sleep before restarting a service
RestartSec=30

[Install]
WantedBy=default.target
```

Enable at login

```
systemctl --user enable mmwatch
```

Start manually
```
systemctl --user start mmwatch
```

# Local development

For local development, execute:

```bash
pip3 install -e .
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mmtools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Fredrik Borg <fredrikb.borg@gmail.com>",
    "download_url": null,
    "platform": null,
    "description": "# mmtools - i3 status bar and notification script for Mattermost\n\nmmtools are various tools using the [mattermost](https://mattermost.org) API.\n\n# Installation\n\n```bash\nsudo pip3 install mmtools\n```\n\nThis will install mmtols from pypi, including the following required packages:\n\n- caep\n- pydantic\n- mattermostdriver\n- passpy\n- notify2\n- dbus-python\n- requests\n\nFor dbus-python to build, you need to have the libdbus-1-dev package installed. On debian you can do\n\n```bash\nsudo apt install libdbus-1-dev\n```\n\n# Tools\n\nThe following tools are included:\n\n### mmstatus\n\n`mmstatus` connects to the mattermost API to get unread messages in all channels. It then outputs a statusbar (usable in i3blocks) of unread messages and exits. Supports private/public/user channels and different coloring on group chats and user chats.\n\nExample configuration for i3blocks:\n\n```\n[mattermost]\ncommand=/usr/local/bin/mmstatus\nseparator=true\ninterval=60\nsignal=12\n```\n\n### mmpolybar\n\n`mmpolybar` same as mmstatus, but with polybar colors.\n\nExample configuration for polybar:\n\n```\n[module/mmpolybar]\ntype = custom/script\nexec = mmpolybar\ntail = true\n```\n\n### mmwaybar\n\n`mmwaybar` same as mmstatus, but with output for waybar.\n\nExample configuration for waybar:\n\n```\n\"custom/mattermost\": {\n    \"exec\": \" mmwaybar\",\n    \"return-type\": \"json\",\n    \"interval\": 90\n}\n```\n\n### mmwatch\n\n`mmwatch` connects to the mattermost websocket API and can display notification on messages and send SIGUSR2 to i3blocks to update statusbar before next interval.\n\n\n## Configuration\n\nAll tools can be configured using both command line arguments and a configuration file.\n\n`mmtools` will first look for a configuration in `~/.config/mmtools/config-<HOSTNAME>` with fallback to `~/.config/mmtools/config`.\n\nUse the following command to create the configuration `~/.config/mmtools/config`. The same configuration file is used for both tools.\n\n```bash\nmmconfig init\n```\n\nIn this file you must specify at least:\n\n```\n# Mattermost server\nserver = <SERVER>\n\n# Mattermost user\nuser = <USERNAME>\n\n# either password\npassword = <MATTERMOST PASSWORD>\n\n# OR pass entry (https://www.passwordstore.org)\npassword-pass-entry = <PASS ENTRY>\n```\n\n## User service for `mmwatch`\n\n`mmwatch` can be started as a systemd user service by creating the following file:\n\n`.config/systemd/user/mmwatch.service`\n\nwith this content:\n\n```\n[Unit]\nDescription=mm watch\n\n[Service]\nExecStart=/usr/local/bin/mmwatch\n\nRestart=always\n\n# time to sleep before restarting a service\nRestartSec=30\n\n[Install]\nWantedBy=default.target\n```\n\nEnable at login\n\n```\nsystemctl --user enable mmwatch\n```\n\nStart manually\n```\nsystemctl --user start mmwatch\n```\n\n# Local development\n\nFor local development, execute:\n\n```bash\npip3 install -e .\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "mmtools",
    "version": "0.0.39",
    "project_urls": {
        "Homepage": "https://github.com/frbor/mmtools"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "abee88c4ded3d4c86e6cd8bf2c07b4fbe48190d4eca2bcc010fde87bece96d4a",
                "md5": "81113715591a79b2cb74d6f80e773bf6",
                "sha256": "926efd7aaadbbcaba87a404fa4116209dd3b2243ddb12ffe2ea8fbc027212f29"
            },
            "downloads": -1,
            "filename": "mmtools-0.0.39-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "81113715591a79b2cb74d6f80e773bf6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 11757,
            "upload_time": "2024-09-10T16:04:01",
            "upload_time_iso_8601": "2024-09-10T16:04:01.512889Z",
            "url": "https://files.pythonhosted.org/packages/ab/ee/88c4ded3d4c86e6cd8bf2c07b4fbe48190d4eca2bcc010fde87bece96d4a/mmtools-0.0.39-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-10 16:04:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "frbor",
    "github_project": "mmtools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mmtools"
}
        
Elapsed time: 0.32569s