Switching Displays with A script? (i'm halfway there!)
#1
I have a monitor and a projector, each with their own xorg.conf

I would like to be able to swap the xorg.confs and then restart gdm

In /etc/X11 I have two files xorg.conf and other.conf

I want to be able to

1- copy the current xorg.conf to temp.conf (overwriting if necessary)
2- copy the other.conf to xorg.conf (overwriting)
3- rename temp.conf to other.conf (overwriting)
4- restart gdm

My attempts at commands are:


cp /etc/X11/xorg.conf /etc/X11/temp.conf
cp /etc/X11/other.conf /etc/X11/xorg.conf
mv /etc/X11/temp.conf /etc/X11/other.conf
sudo /etc/init.d/gdm restart

Could a kind soul help me make this into some kind of script (i don't know if i've got the right word, basically i want a linux .bat)

The idea is to double click an icon on the desktop, or run a simple command to go from the current display (be it projector or monitor) to the other one.

Thanks for taking the time to read this.Nerd
Reply
#2
Look up a simple example of bash script on the google and edit it to run your command.
The only tricky part compared to windows is that you have to make the file executable AND if I remember correctly you should use the full path when you run it.

I also think it is possible to put both monitors in the same xorg?
Reply
#3
thanks for your help.

i will do my best.
Reply
#4
thanks,

I got it working!
Reply

Logout Mark Read Team Forum Stats Members Help
Switching Displays with A script? (i'm halfway there!)0