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?
I solved this by having the /etc/init/monitors.conf file to contain the following: