Metadata-Version: 2.1
Name: traycortex
Version: 0.2.1
Summary: borgmatic systray icon
License: GPL-3.0-only
Author: Sebastian Stark
Author-email: sstark@mailbox.org
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: pillow (>=10.3.0,<11.0.0)
Requires-Dist: platformdirs (>=4.2.2,<5.0.0)
Requires-Dist: pygobject (>=3.48.2,<4.0.0)
Requires-Dist: pystray (>=0.19.5,<0.20.0)
Description-Content-Type: text/markdown


# Traycortex

Tray icon for borgmatic.

**(Early work in Progress.)**

traycortex is an application that will show the status of [borgmatic
backup](https://torsion.org/borgmatic/) in your system tray.

Along with it comes a traycortex-cli application, that is used in the borgmatic
hooks configuration to signal the tray icon. Currently the only states that are
implemented are "job_started" and "job_finished".

![screenshot of tray running](doc/tray-running.png)

When the status of a backup is updated, a notification will be displayed and the
icon changes accordingly.


## Installation

### Prerequites

Some packages are required to build and install traycortex (probably incomplete):

  - Ubuntu: `apt install libcairo2-dev python-gi-dev libgirepository1.0-dev`
  - Arch: `pacman -S gobject-introspection python-cairo libappindicator-gtk3`

Recommended way to install:

    pipx install traycortex

Also works:

    pip install traycortex

*Packagers welcome*


## Configuration File

Location: `$XDG_CONFIG_HOME/traycortex.ini`

Currently the only configuration that is possible is the authkey that is used
to authenticate the connection between *traycortex* and *traycortex-cli*

Example:

    [connection]
    authkey = ce03f7af891ebc29defc0643faf71025

To create a working minimal configuration (if you do not have one already) use:

    traycortex-cli --ini

This will generate a random authkey and place it in a new configuration file.
If a configuration file already exists, above command will fail.

### Other Configuration File Options

The command used to create a backup (when selecting the "Engage" menu item):

    [borgmatic]
    ; default: borgmatic
    command = systemd-inhibit --why="Backup is running" /usr/local/bin/borgmatic


## Tray Menu

  - **Engage**: Run a borgmatic backup
  - **Discard**: Quit traycortex and remove the icon from the tray


## Integrating with borgmatic

Example `~/.config/borgmatic.d/home.yaml`:

    [...]
    source_directories:
        - /home/seb
    repositories:
        - path: ssh://...
    before_backup:
        - traycortex-cli job_started
    after_check:
        - traycortex-cli job_finished
    [...]


## Running

To start the tray application:

    traycortex &

Other methods of starting will be investigated (.desktop file, systemd user unit)

