Created attachment 124768
Patch which adds those listed variables
Even though when pkexec is not designed to run X11 apps it shouldn't remove environment variables for GUI apps. They are needed for proper look&feel integration.
GUI applications need the following environment variables forwarded:
There are some more that may make sense to forward, such as KDE_IS_PRELINKED, QT_PLUGIN_PATH, XDG_DATA_DIRS etc., but some of those may be considered security issues. The ones in my list above are perfectly safe though.
Created attachment 124768
Patch which adds those listed variables
Even though when pkexec is not designed to run X11 apps it shouldn't remove environment variables for GUI apps. They are needed for proper look&feel integration.
GUI applications need the following environment variables forwarded:
KDE_FULL_SESSION SESSION_ ID FORCE_SOFTWARE_ OPENGL PLATFORMTHEME
KDE_SESSION_VERSION
DESKTOP_SESSION
GNOME_DESKTOP_
XDG_CURRENT_DESKTOP
QT_STYLE_OVERRIDE
QT_XCB_
QT_QPA_
There are some more that may make sense to forward, such as KDE_IS_PRELINKED, QT_PLUGIN_PATH, XDG_DATA_DIRS etc., but some of those may be considered security issues. The ones in my list above are perfectly safe though.