No tray icons when running as root
KMouratidis opened this issue ยท 3 comments
I'm having an issue in Fedora 35 where a container for the system tray icon is created but the icon is empty (I've tried both the Appindicator and Tray Icons reloaded).
Jobs are started from root cron:
#Back In Time system entry, this will be edited by the gui:
0 8,12,16,20 * * * /usr/bin/nice -n19 /usr/bin/ionice -c2 -n7 /usr/bin/backintime backup-job >/dev/null
#Back In Time system entry, this will be edited by the gui:
0 9 * * * /usr/bin/nice -n19 /usr/bin/ionice -c2 -n7 /usr/bin/backintime --profile-id 2 backup-job >/dev/null
This issue might be related. Torguard also runs as root so that may not be the problem.
Extra info, if it helps
gnome-shell --version
: GNOME Shell 41.4
uname -r
: 5.16.16-200.fc35.x86_64
backintime --version
: backintime 1.3.1 (latest on fedora)
qt/icon.py:BIT_LOGO = QIcon.fromTheme('document-save')
I wonder if it's your (or root's) theme?
I recently played around with changing themes and now I get an empty tray spot for copyq (a clipboard manager). There just aren't icons for for copyq in the theme I chose.
I just "fixed" that by installing and running qt5ct
.
And just as I posted this and was cleaning up it seems it works now, even with .desktop
. Anyway, thanks again for the inspiration!
Well, now it works ๐
Thanks, that makes sense. Running backintime as root from the terminal works nicely if I use `QT_QPA_PLATFORMTHEME` (it seems it doesn't work for `backintime-qt_polkit` and `backintime-qt-root`):QT_QPA_PLATFORMTHEME=qt5ct backintime-qt
qt5ct doesn't do anything on its own (icons are already there). However, this doesn't work for the app menu entry. I tried modifying /usr/bin/backintime
like this:
...
QT_QPA_PLATFORMTHEME=qt5ct python3 -Es $APP_PATH/backintime.py "$@"
which creates a system tray icon (yay!) both for manually launched backups and for cron, but it doesn't load icons in the GUI. guess that's hacky but good enough. I tried adding this variable to the .desktop
files, and noticed that it's using backintime-qt_polkit
which for some reason doesn't work even if I modify the PREFIX.
#!/usr/bin/sh
if [ "x$XDG_SESSION_TYPE" = "xwayland" ]; then
PREFIX="env QT_QPA_PLATFORM=wayland-egl XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR"
else
PREFIX=""
fi
pkexec --disable-internal-agent $PREFIX "/usr/bin/backintime-qt" "$@"
QT_QPA_PLATFORMTHEME=qt5ct
[...]
which creates a system tray icon (yay!) both for manually launched backups and for cron, but it doesn't load icons in the GUI.
If your have installed qt5ct
you also have to activate an icon set manually (choose and click on "Apply") by using the qt5ct
GUI (start via terminal) otherwise you will see only text but no icons in the BiT GUI: