Closed bricebasty closed 11 months ago
Hi there! As you're new to this repo, please make sure you've used an appropriate issue template and searched for duplicates (it helps us focus on actual development!). We'd also like to suggest that you read our contribution guidelines and our code of conduct. Thanks a bunch for opening your first issue! 🙏
Hey there!
So, I've been tinkering a bit and finally found the solution! It was not a bug, but a misunderstanding of how X sessions work.
I used systemd to create a daemon in the user's session.
Back to the solution
/home/YOURNAME/.config/systemd/user
(create folder if non-existent)MODIFY THE PATHS IN ALL CAPS IN ExecStart
TO BE IN ACCORDANCE WITH YOUR ACTIVITYWATCH FOLDER
aw-server.service
⏬
[Unit]
Description=ActivityWatch Server
After=network.target
[Service]
ExecStart=/PATH/TO/activitywatch/aw-server/aw-server
Restart=always
[Install]
WantedBy=default.target
aw-watcher-window.service
⏬
[Unit]
Description=ActivityWatch Window Watcher
After=network.target
[Service]
ExecStart=/PATH/TO/activitywatch/aw-watcher-window/aw-watcher-window
Restart=always
[Install]
WantedBy=default.target
aw-watcher-afk.service
⏬
[Unit]
Description=ActivityWatch AFK Watcher
After=network.target
[Service]
ExecStart=/PATH/TO/activitywatch/aw-watcher-afk/aw-watcher-afk
Restart=always
[Install]
WantedBy=default.target
$ systemctl --user daemon-reload
$ systemctl --user start aw-watcher-afk
$ systemctl --user start aw-watcher-window
$ systemctl --user start aw-server
$ systemctl --user enable aw-watcher-afk
$ systemctl --user enable aw-watcher-window
$ systemctl --user enable aw-server
Describe the bug
When launching the executable outside of the console,
aw-watcher-windows
andaw-watcher-afk
don't work. Same for launching from the recommendedstart.sh
hereWhen launching both of them separately from the console, then it works (but is very annoying to do).
In red launched from console directly/In green launched from script or from executables:![2023-07-29-103700_2560x1440_scrot](https://github.com/ActivityWatch/activitywatch/assets/25788991/bcaebd45-f3c6-40cc-8cda-7479d1cc450c)
Steps to reproduce
Just use the
start.sh
recommended.Expected behavior
AW logging the time from launching with the executables.