Skip to content

Commit

Permalink
Add systemd sample configs and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
2e3s committed Jul 19, 2024
1 parent 810707c commit baf0519
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

### Bundle with built-in ActivityWatch

Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 16 additions & 0 deletions config/awatcher.service
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit baf0519

Please sign in to comment.