Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 2 down vote accepted

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

gtk-theme-name="Redmond"
gtk-icon-theme-name="hicolor"
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
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
add comment

Your Answer

 
discard

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.