2

I was trying to autostart ActivityWatch . Made a activitywatch.service file in /etc/systemd/system .

[Unit]
Description=Activity Watch
After=network.target

[Service]
Type=simple
User=%i
ExecStart=/home/anoopd/venv/bin/aw-qt -c "~/.config/activitywatch"

[Install]
WantedBy=multi-user.target

Reloaded systemed sudo systemctl --system daemon-reload

To start automatically at boot:

sudo systemctl enable activitywatch

To start it now:

sudo systemctl start activitywatch

When I checked the status:

$ sudo systemctl status activitywatch
● activitywatch.service - Activity Watch
Loaded: loaded (/etc/systemd/system/activitywatch.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-09-06 09:13:10 IST; 25min ago
Process: 11013 ExecStart=/home/anoopd/venv/bin/aw-qt -c ~/.config/activitywatch (code=exited, status=2)
Main PID: 11013 (code=exited, status=2)

Sep 06 09:13:08 anoops-ubuntu systemd[1]: Started Activity Watch.
Sep 06 09:13:09 anoops-ubuntu aw-qt[11013]: usage: aw-qt [-h] [--testing] [--autostart-modules AUTOSTART_MODULES]
Sep 06 09:13:09 anoops-ubuntu aw-qt[11013]: aw-qt: error: unrecognized arguments: -c ~/.config/activitywatch
Sep 06 09:13:10 anoops-ubuntu systemd[1]: activitywatch.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Sep 06 09:13:10 anoops-ubuntu systemd[1]: activitywatch.service: Unit entered failed state.
Sep 06 09:13:10 anoops-ubuntu systemd[1]: activitywatch.service: Failed with result 'exit-code'.

I am not sure about the INVALIDARGUMENT . Please help .

Edit

I completely removed the -c param from ExecStart and now the status is giving the error:

● activitywatch.service - Activity Watch
Loaded: loaded (/etc/systemd/system/activitywatch.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-09-06 09:54:13 IST; 5s ago
Process: 15036 ExecStart=/home/anoopd/venv/bin/aw-qt (code=exited, status=1/FAILURE)
Main PID: 15036 (code=exited, status=1/FAILURE)

Sep 06 09:54:13 anoops-ubuntu aw-qt[15036]:   File "/home/anoopd/venv/lib/python3.5/site-packages/aw_qt/manager.py", line 149, in autostart
Sep 06 09:54:13 anoops-ubuntu aw-qt[15036]:     self.start("aw-server")
Sep 06 09:54:13 anoops-ubuntu aw-qt[15036]:   File "/home/anoopd/venv/lib/python3.5/site-packages/aw_qt/manager.py", line 142, in start
Sep 06 09:54:13 anoops-ubuntu aw-qt[15036]:     self.modules[module_name].start()
Sep 06 09:54:13 anoops-ubuntu aw-qt[15036]:   File "/home/anoopd/venv/lib/python3.5/site-packages/aw_qt/manager.py", line 50, in start
Sep 06 09:54:13 anoops-ubuntu aw-qt[15036]:     os.setpgrp()
Sep 06 09:54:13 anoops-ubuntu aw-qt[15036]: PermissionError: [Errno 1] Operation not permitted
Sep 06 09:54:13 anoops-ubuntu systemd[1]: activitywatch.service: Main process exited, code=exited, status=1/FAILURE
Sep 06 09:54:13 anoops-ubuntu systemd[1]: activitywatch.service: Unit entered failed state.
2
  • I have the same issue. Did you figure it out?
    – Hatshepsut
    Aug 20, 2019 at 23:46
  • It says "Operation not permitted" - have you tried running it with root privileges? What happens if you run it manually in the command-line?
    – xeruf
    Aug 18, 2020 at 20:16

1 Answer 1

0

Can be done manually by adding aw-qt in the Startup Applications.

aw-qt executable

Reference: ActivityWatch / activitywatch Document how to autostart for all platforms #116

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .