Why is QSystemTrayIcon.isSystemTrayAvailable() False running as root but True as user?
On Ubuntu 20.04 with Gnome3 and X11 and Qt5.12.8 (PyQt 5.14.1) from PyQt5.QtWidgets import QSystemTrayIcon, QApplication qapp = QApplication(['']) print(str(QSystemTrayIcon.isSystemTrayAvailable())) shows True as user and False as root (via sudo as well as via pkexec). How can I find out the reason for "False as root" (is there a way to enable logging for this) and how can I enable system tray icons also for code running as root? I have also tried to inject the user's X11 env vars but this does not help: pkexec env DISPLAY=$DISPLAY XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR XAUTHORITY=$XAUTHORITY python
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.