Apps lose the default system theme when run with lxqt-sudo or pkexec

I’m testing lubuntu focal and the apps don’t get theme of system when running with pkexec or lxqt-sudo.


lxqt-sudo software-properties-kde
lxqt-sudo featherpad
pkexec system-config-samba

Are there some way to apply theme using variables or some kind of trick?

In gnome I can switch theme using env GTK_THEME='NameOfTheme' AppCommand.

Since lxqt-sudo is typically a frontend to sudo, you should be able to use switches from it, like -E to preserve your existing environment.

Alternately, you could probably copy over all the config stuff to /root.

1 Like

And there is no reason to run featherpad with elevated privileges.


Yes, that’s unsettling for me too, but it’s easily solved by running lxqt-sudo lxqt-config and setting the appearance options you have in user mode.


It depends, it’s an option if you don’t want to make modifications of certain system files with the nano editor in the terminal.

1 Like

No, it does not depend. Featherpad is an editor. If you start it, you can edit files. Simple and easy, every feature of featherpad works. No need for elevated privileges.

A file has certain permissions set. Normally, this has a good reason. For example, a user without write privilege cannot change the content of the file. This behaviour is the same for all editors.
If you change the permissions of the file, you are able to edit the file and then you can reset the old permissions.
Another approach is to create a copy of the file, modify the file and then replace the original file with the modified copy. That is, what sudoedit does.
With GNOME, you can use the admin:// gvfs backend.
If you understand the system, you can do whatever you need, without running a graphical application with elevated permissions.

It was just to illustrate the problem, even though I used it a few times in testing on the virtual machine, its more fast and easy. But in production I don’t do that.

Thanks man,

The theme just works if I copy folder .config to /.

It works! But was need copy to /root and /.

Unfortuness there is no option -E in lxqt-sudo.

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