Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I have a computer at home that I log into remotely. The "monitor" for it is a TV, so I want gtk applications to use a large font and icon theme, which I managed to do by editing the ~/.gtkrc-2.0 file and some other similar stuff. What I want to be able to do is have a separate theme for when I'm logging in remotely. The best way to explain is that I would like my gtk theme choice to be dependent on the X display that the application is started on. For example, if I start something on :0.0 then that is the TV and I want large fonts, but if I start it on localhost:10.0 I want to use a regular size font, because it will get rendered on my laptop screen.

The elegant solution would be to have some sort of IF statement in the .gtkrc-2.0 file that checks the $DISPLAY variable and behaves accordingly. The problem is I can't find any documentation on control structures in .gktrc files, or if it's even possible to do that.

[Edit] Additionally, is there any way to do this in GTK+ 3 without having to install gnome?

share|improve this question
up vote 1 down vote accepted

You could achieve this by running an Xsettings daemon such as gnome-settings-daemon locally on both machines; it will affect all clients of the X display it's running on, overriding gtkrc.

If the program uses GTK+ 2, you can point $GTK2_RC_FILES to a colon-separated list of alternative gtkrc's. (There is no direct alternative for GTK+ 3 settings.ini; it uses Xsettings as the primary mechanism.)

share|improve this answer
I am pretty sure gnome-settings-daemon requires installing gnome, which is something I'm trying to avoid, as I want to keep a somewhat minimalistic setup. A google search for Xsettings daemon returns gnome-settings-daemon and basically nothing else. Is there a way to have this work for both GTK+ 2/3 without having to install the fullness of gnome? – vlsd Nov 22 '11 at 19:42
I am pretty sure it doesn't. I've used it with wmii myself. – grawity Nov 22 '11 at 19:50
OK, I'll give it a try, I was probably reading the dependency list wrong. – vlsd Nov 22 '11 at 19:52

AFAIK it is not possible to make do any scripting for gtkrc. You can copy both configurations to somewhere where you can restore them from .xinitrc, .xsession or other X startup file. The only problem is that you can't use both :0.0 and :10.0 running in parallel with different themes. You should either run only one X at time or make different user with different home directory for your TV setup for instance. You can even use the same UID/GID for both users and will have access to all files.

share|improve this answer

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.