Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
task
setuid root
exec /etc/X11/monitors.sh

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

1 Answer 1

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/monitors.sh
share|improve this answer
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.