Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No tray icons when running as root #1240

Closed
KMouratidis opened this issue Mar 27, 2022 · 3 comments
Closed

No tray icons when running as root #1240

KMouratidis opened this issue Mar 27, 2022 · 3 comments

Comments

@KMouratidis
Copy link

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).

Screenshot from 2022-03-27 11-58-49

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)

@gsker
Copy link

gsker commented Mar 27, 2022

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.

@KMouratidis
Copy link
Author

KMouratidis commented Mar 27, 2022

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" "$@"

@aryoda
Copy link
Contributor

aryoda commented Nov 20, 2022

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:

qt5ct icon theme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants