Super User is a question and answer site for computer enthusiasts and power users. 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

How can I load the settings from ~/.Xresources when system is loaded? Currently, I write

xrdb ~/.Xresources

everytime I start the system and I'd like to automate it somehow.

I use Ubuntu 12.04 with LightDM.

share|improve this question
up vote 3 down vote accepted

It's automatically read by some DMs, but in your case, you can add the following command to your ~/.initrc so that it's executed at each session start:

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

The first part ensures that you won't get an error if you decide to delete .Xresources in the future, and the -merge option allows you to add your custom properties to the ones that can have been previously defined, instead of replacing the whole set.

If this still doesn't do, try creating a ~/.xprofile file that contains the following line: USRRESOURCES=$HOME/.Xresources

share|improve this answer
Thanks for the answer. Sadly, it doesn't work for me. Maybe it's because I use LightDM which doesn't read .initrc I'm not sure. – evfwcqcg Sep 30 '12 at 13:02
That's just weird, LightDM is supposed to read and merge .Xresources automatically. What are the permissions? Are you sure the name is correct? – m4573r Sep 30 '12 at 13:54
Yes, the name is correct and permissions are -rw-rw-r--. I also tried to change permissions to 777 (sudo chmod 777 ~/.Xresources) but without luck. – evfwcqcg Sep 30 '12 at 14:24
Hmm... found this bit on a forum: create a ~/.xprofile file that contains the following: USRRESOURCES=$HOME/.Xresources – m4573r Sep 30 '12 at 18:31
Thank you very much, it works! – evfwcqcg Sep 30 '12 at 19:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .