You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both aw-watcher-afk and aw-watcher-window are crashing on startup:
-- Boot d98014b0da0a4689aa35788c5e380235 --
říj 14 21:51:52 desktop systemd[2894]: Started ActivityWatch watcher 'aw-watcher-window'.
říj 14 21:51:53 desktop aw-watcher-window[2978]: Traceback (most recent call last):
říj 14 21:51:53 desktop aw-watcher-window[2978]: File "/nix/store/69g5zb7z36cf04lazngghn4qykh2faz7-aw-watcher-window-0.12.2/bin/.aw-watcher-window-wrapped", line 9, in <module>
říj 14 21:51:53 desktop aw-watcher-window[2978]: sys.exit(main())
říj 14 21:51:53 desktop aw-watcher-window[2978]: ^^^^^^
říj 14 21:51:53 desktop aw-watcher-window[2978]: File "/nix/store/69g5zb7z36cf04lazngghn4qykh2faz7-aw-watcher-window-0.12.2/lib/python3.12/site-packages/aw_watcher_window/main.py", line 40, in main
říj 14 21:51:53 desktop aw-watcher-window[2978]: raise Exception("DISPLAY environment variable not set")
říj 14 21:51:53 desktop aw-watcher-window[2978]: Exception: DISPLAY environment variable not set
říj 14 21:51:53 desktop systemd[2894]: activitywatch-watcher-aw-watcher-window.service: Main process exited, code=exited, status=1/FAILURE
říj 14 21:51:53 desktop systemd[2894]: activitywatch-watcher-aw-watcher-window.service: Failed with result 'exit-code'.
When I start them manually using systemctl --user restart activitywatch-watcher-aw-watcher-afk.service activitywatch-watcher-aw-watcher-window.service or systemctl --user restart activitywatch.target, they crash again when the system is shutting down:
Note that this workaround is not ideal because activitywatch.target itself shouldn't really need a GUI. I'm not sure if there is a way to tell whether an arbitrary watcher needs to be started after graphical-session.target or not.
Are you following the right branch?
Is there an existing issue for this?
Issue description
Both
aw-watcher-afk
andaw-watcher-window
are crashing on startup:When I start them manually using
systemctl --user restart activitywatch-watcher-aw-watcher-afk.service activitywatch-watcher-aw-watcher-window.service
orsystemctl --user restart activitywatch.target
, they crash again when the system is shutting down:It seems like the watchers are started before Xorg is started, and when shutting down they aren't stopped before Xorg is stopped.
This is my ActivityWatch config:
Workaround
The problem can be fixed by adding the following snippet to the home-manager config:
Note that this workaround is not ideal because
activitywatch.target
itself shouldn't really need a GUI. I'm not sure if there is a way to tell whether an arbitrary watcher needs to be started aftergraphical-session.target
or not.Maintainer CC
@foo-dogsquared
System information
The text was updated successfully, but these errors were encountered: