Can't run aw-qt under Gnome


#1

Hey, there! Just started using ActivityWatch(Version: v0.8.0b6) for Linux(Gnome 3.30 under Xorg) although it works great, I keep running into problems.

tl;dr: Having trouble running aw-qt on Gnome, and some of the apps show up as unknown in activities.

First of all, I can’t get aw-qt to run under Gnome it fails with the following error message Error Popup
and the following console log:

I can somewhat make out the issue here is due to the fact, Gnome doesn’t have a systray, but I am not sure if systray apps are supposed to crash instantly.
Anyways, I got away from this problem by using systemd unit files. Specifically, these three user units running in userspace.


~
❯ cd .config/systemd/user/

~/.config/systemd/user
❯ ls
activity_watcher_afk.service	 activity_watcher_window.service
activity_watcher_server.service  default.target.wants

~/.config/systemd/user
❯ cat activity_watcher_afk.service activity_watcher_server.service activity_watcher_window.service
[Unit]
Description=The activity watcher for afk
Wants=activity_watcher_window.service activity_watcher_server.service

[Service]
Type=simple
ExecStart=/home/deen/.local/bin/aw-watcher-afk
Restart=always
RestartSec=3

[Install]
WantedBy=default.target
[Unit]
Description=The activity watch server
Wants=activity_watcher_window.service activity_watcher_afk.service

[Service]
Type=simple
ExecStart=/home/deen/.local/bin/aw-server
Restart=always
RestartSec=3

[Install]
WantedBy=default.target
[Unit]
Description=The activity watcher for windows
Wants=activity_watcher_server.service activity_watcher_afk.service

[Service]
Type=simple
ExecStart=/home/deen/.local/bin/aw-watcher-window
Restart=always
RestartSec=3

[Install]
WantedBy=default.target

~/.config/systemd/user
❯ 

Succesfully launching the server at localhost:5600,
Which brings me to my second problem, some of the applications just don’t show up and show as unknown in the activity page i.e both the Application name and Window titles are both unknown.
If I were to guess, this might be an issue with only Gtk+ applications (can confirm with gnome-terminal and tilix) maybe due to my unit file missing some kind of environment configuration.
If it helps here’s an output of aw-watcher-window in journalctl:

General Info:

~
❯ uname -a
Linux hbar 4.18.12-arch1-1-ARCH #1 SMP PREEMPT Thu Oct 4 01:01:27 UTC 2018 x86_64 GNU/Linux

~
❯ gnome-shell --version
GNOME Shell 3.30.0

~
❯ printenv
LANG=en_US.UTF-8
DISPLAY=:0
SHLVL=1
LOGNAME=deen
ZEITGEIST_DATA_PATH=/home/deen/.local/share/zeitgeist
XDG_VTNR=2
HG=/usr/bin/hg
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
XAUTHORITY=/run/user/1000/gdm/Xauthority
PWD=/home/deen
GIO_LAUNCHED_DESKTOP_FILE=/etc/xdg/autostart/org.gnome.SettingsDaemon.MediaKeys.desktop
COLORTERM=truecolor
XDG_SESSION_ID=5
DESKTOP_SESSION=gnome-xorg
XDG_SESSION_DESKTOP=gnome-xorg
GDMSESSION=gnome-xorg
USERNAME=deen
WINDOWPATH=2
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
VTE_VERSION=5401
MAIL=/var/spool/mail/deen
XDG_DATA_DIRS=/home/deen/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/
XDG_MENU_PREFIX=gnome-
GDM_LANG=en_US.UTF-8
OLDPWD=/home/deen
XDG_SESSION_TYPE=x11
SHELL=/bin/zsh
TERM=xterm-256color
SESSION_MANAGER=local/hbar:@/tmp/.ICE-unix/9896,unix/hbar:/tmp/.ICE-unix/9896
XDG_CURRENT_DESKTOP=GNOME
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
PATH=/home/deen/.local/node/bin:/home/deen/.local/android-studio/bin:/home/deen/.local/jdk1.8.0_172/bin:/home/deen/.local/cargo/bin:/home/deen/.local/bin:/home/deen/.config/pyenv/plugins/pyenv-virtualenv/shims:/home/deen/.config/pyenv/shims:/home/deen/.config/pyenv/bin:/home/deen/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/home/deen/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
HOME=/home/deen
XDG_SEAT=seat0
TILIX_ID=9d8706b9-a655-4bcc-8407-956d622858a9
XDG_RUNTIME_DIR=/run/user/1000
GIO_LAUNCHED_DESKTOP_FILE_PID=10254
USER=deen
PROMPT_EOL_MARK=
PYENV_ROOT=/home/deen/.config/pyenv
PYENV_SHELL=zsh
PYENV_VIRTUALENV_INIT=1
GNUPGHOME=/home/deen/.config/gpg
EDITOR=nvim
JAVA_HOME=/home/deen/.local/jdk1.8.0_172
VIRTUAL_ENV_DISABLE_PROMPT=12
_=/usr/bin/printenv

Edit: Accidentally added info about Wayland session

Edit 2: Sorry for jumping without troubleshooting enough, turns out updating Gnome switched me back to Wayland, sorry for the trouble…

ActivityWatch Version: v0.8.0b6

Thanks for listening!


#2

Yeah, in the future we really should creating a indicator instead of a systray icon with aw-qt (if I remember correctly the systray is dependent on Xorg while indicators are not).

But if i understood correctly, aw-qt works now that you are no longer running in wayland or are you still using your systemd services even on Xorg to get it woring?


#3

Hi, Thanks for replying! Just to be sure I tried re-running aw-qt again under Xorg/X11 and get the same exact error as before, so yeah aw-qt does not work under Gnome X11 too, and I’m still using the systemd to run activity watch.


#4

Ah, ok.

Googled and it seems like they removed the trayicon support completely in Gnome 2.26, so to support that we need to go over to a app-indicator instead of trayicon.