When using sudo, applications do not follow the GTK2 theme and font. How can I set identical settings for use when an application is run from root, but while inside a desktop from a user?


You can create a .gtkrc-2.0 file inside /root, such as

gtk-font-name="Sans 10"

Or, can install an utility like lxappearance and run it with sudo, then you can set the theme graphically.

  • Should the user account have this file somewhere? I think I could symlink or copy the file to the root folder, however, I do not see a hidden .gtkrc file anywhere in the user account. How are these settings stored for a user account? – Village Feb 26 '12 at 1:23
  • 1
    In the user account you also have a .gtkrc-2.0 in your HOME directory. – Renan Feb 26 '12 at 1:24
  • There is no .gtkrc-2.0 file in my home directory of the user account, yet I have a custom theme set. Does XFce4 store this information differently? – Village Feb 26 '12 at 1:26
  • 1
    I think so, probably it stores the GTK configuration in another form. Anyway, you can just use lxappearance to create a .gtkrc-2.0 file. – Renan Feb 26 '12 at 1:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.