Dark mode for GUI application run with sudo

February 7, 2022 - Reading time: ~1 minute

Some application like Timeshift or Nvidia Settings run with sudo have the default distribution light theme. In order to have customized theme, one can run System Settings as root to configure everything with the following command:

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

It is then easy to select the theme for the desktop, the GTK applications, the windows decoration and so on, to match the user desktop customization.