Can not open KDE system setting when using root

I need to change QT theme for root applications. The other solution said that you need to run systemsettings5 as root that can change QT theme for root user.
but sudo systemsettings5 can not open KDE system setting as root.

❯ sudo systemsettings5
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
kf.dbusaddons: DBus session bus not found. To circumvent this problem try the following command (with bash):
    export $(dbus-launch)

kdesu systemsettings5 does not work.

I checked it in Manjaro KDE VM, same issue.
OpenSUSE the last version has no issue in VM.

Do you have idea to fix this problem for Manjaro?

not best with pkexec (other error)…

pkexec systemsettings5
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

manjaro and archlinux

The same issue.

Try with

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dbus-launch systemsettings5

Try now:

sudo dbus-launch systemsettings5

It seems like you already found a solution but I think a much safer alternative solution is to use a tool like konsave to transfer your user config to root. That way you don’t have to run any GUI tools which could potentially have side effects as root.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.