Add systemd sample configs and docs

This commit is contained in:
Demmie 2024-07-19 00:46:08 -04:00
parent 810707cc46
commit a04578083f
No known key found for this signature in database
GPG Key ID: B06DAA3D432C6E9A
3 changed files with 19 additions and 1 deletions

View File

@ -20,6 +20,7 @@ The binaries for the bundle, bundled DEB and ActivityWatch watchers replacement
- Remove `aw-watcher-window` and `aw-watcher-afk` from autostart at `aw-qt/aw-qt.toml` in [config directory](https://docs.activitywatch.net/en/latest/directories.html#config),
add `aw-awatcher`.
- Restart ActivityWatch. In the Modules submenu there should be a new checked module **aw-awatcher**. Note that awatcher shows up in the Web UI under Timeline as `aw-watcher-window_$HOSTNAME`.
- Optionally, you can use systemd instead of ActivityWatch runner. In this case, skip adding `aw-awatcher` to `aw-qt.toml` and install this service [configuration](https://github.com/2e3s/awatcher/blob/main/config/aw-awatcher.service). In this case, ActivityWatch server also must be managed by systemd (as `aw-server.service` in the config).
### Bundle with built-in ActivityWatch
@ -35,6 +36,7 @@ They are controled from the tray, no additional configuration is necessary.
It is recommended to use `~/.config/autostart` for the bundle. This folder is employed by "Autostart" in KDE settings and Gnome Tweaks.
Systemd may require to sleep for a few seconds (`ExecStartPre=/bin/sleep 5`) in order to wait for the environment.
See this service [configuration](https://github.com/2e3s/awatcher/blob/main/config/awatcher.service).
## Supported environments

View File

@ -14,4 +14,4 @@ After=aw-server.service graphical-session.target
Requires=aw-server.service
[Install]
WantedBy=graphical-session.target
WantedBy=graphical-session.target

16
config/awatcher.service Normal file
View File

@ -0,0 +1,16 @@
[Service]
Type=simple
TimeoutStartSec=120
ExecStartPre=/bin/sleep 5
ExecStart=awatcher
Restart=always
RestartSec=5
RestartSteps=2
RestartMaxDelaySec=15
[Unit]
Description=AWatcher
After=graphical-session.target
[Install]
WantedBy=graphical-session.target