Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I've got a computer which I use at a couple of different sites, and I've got differen monitors at those sites. What I've done is that I've ceated different xorg.conf files for each of these sites.

Now, I've created a script which queries the nvidia driver for connected monitors, and based on those I apply the right xorg.conf file. However, I'd like this process to take place automatically during startup. However, I can't really get things to work.

I've been trying with Upstart, and created the following monitors.conf file in /etc/init:

description "configure monitors"

start on starting gdm
setuid root
exec /etc/X11/

I've read that start on starting gdm is the right way to run a script just before X11 is about to start. I need to run the script just before X11 to have X11 to pick up the right X11 .conf file. However, nothing really happens?

share|improve this question

I solved this by having the /etc/init/monitors.conf file to contain the following:

description "configure monitors"

start on login-session-start

exec /home/myuser/.x11/
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.