Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer
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
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
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 posting your answer, you agree to the privacy policy and terms of service.

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