huwshimi
June 21st, 2005, 07:46 AM
I have my laptop attached to a second monitor when it is at home, however when I take it anywhere some applications get put where that monitor used to be. Hopefully in the future someone will make a nice GUI to switch between one or two monitors (or it'll happen behind the scenes like magic). Until then, this is my solution that uses a right click script and a restart of X.
A warning. During this process you are going to edit your xorg.conf. If you break this then you may not have any graphical interface. However, I assume that anyone who has gotten past the stage of setting up a multiple monitor desktop is well aware of the risks involved.
First we need to assume that you have your xorg.conf set for multiple monitors (to do so search these forums). Next you need to create copies of your xorg.conf.
sudo cp /etc/X11/xorg.conf /etc/X11/xorg_multiple_monitors.conf
sudo cp /etc/X11/xorg.conf /etc/X11/xorg_single_monitor.conf
Now we edit xorg_single_monitor.conf for use with only one monitor (if you have a backup of the original you might be able to use that). As above we are assuming you're xorg_multiple_monitors.conf is already set up correctly.
sudo gedit /etc/X11/xorg_single_monitor.conf
Having created the copies of xorg.conf, we can now make the scripts.
gedit $HOME/.gnome2/nautilus-scripts/Single\ \(duplicate\)\ desktop
Enter the following into the new file:
sudo cp /etc/X11/xorg_single_monitor.conf /etc/X11/xorg.conf
Save that file, and do the same for multiple monitor setup.
gedit $HOME/.gnome2/nautilus-scripts/Extend\ desktop\ to\ second\ monitor
Enter the following into the new file:
sudo cp /etc/X11/xorg_multiple_monitors.conf /etc/X11/xorg.conf
Save again. Now we make these scripts show in the menu.
chmod +x $HOME/.gnome2/nautilus-scripts/Single\ \(duplicate\)\ desktop
chmod +x $HOME/.gnome2/nautilus-scripts/Extend\ desktop\ to\ second\ monitor
Now when you want to switch between the two setups, you right click on the desktop or in a folder, go to: Scripts - > Extend desktop to second monitor, or Scripts - > Single (duplicate) desktop. Select the appropriate one of these options and hit Control-Alt-Backspace. And (hopefully) there you have it.
Now another word of warning. This process replaces your xorg.conf, so when you make a change to one file you HAVE to make it to the others. Also I have not really tested this, so use it at your own risk.
If what I have written is wrong or is going to break something, would someone please tell me.
A warning. During this process you are going to edit your xorg.conf. If you break this then you may not have any graphical interface. However, I assume that anyone who has gotten past the stage of setting up a multiple monitor desktop is well aware of the risks involved.
First we need to assume that you have your xorg.conf set for multiple monitors (to do so search these forums). Next you need to create copies of your xorg.conf.
sudo cp /etc/X11/xorg.conf /etc/X11/xorg_multiple_monitors.conf
sudo cp /etc/X11/xorg.conf /etc/X11/xorg_single_monitor.conf
Now we edit xorg_single_monitor.conf for use with only one monitor (if you have a backup of the original you might be able to use that). As above we are assuming you're xorg_multiple_monitors.conf is already set up correctly.
sudo gedit /etc/X11/xorg_single_monitor.conf
Having created the copies of xorg.conf, we can now make the scripts.
gedit $HOME/.gnome2/nautilus-scripts/Single\ \(duplicate\)\ desktop
Enter the following into the new file:
sudo cp /etc/X11/xorg_single_monitor.conf /etc/X11/xorg.conf
Save that file, and do the same for multiple monitor setup.
gedit $HOME/.gnome2/nautilus-scripts/Extend\ desktop\ to\ second\ monitor
Enter the following into the new file:
sudo cp /etc/X11/xorg_multiple_monitors.conf /etc/X11/xorg.conf
Save again. Now we make these scripts show in the menu.
chmod +x $HOME/.gnome2/nautilus-scripts/Single\ \(duplicate\)\ desktop
chmod +x $HOME/.gnome2/nautilus-scripts/Extend\ desktop\ to\ second\ monitor
Now when you want to switch between the two setups, you right click on the desktop or in a folder, go to: Scripts - > Extend desktop to second monitor, or Scripts - > Single (duplicate) desktop. Select the appropriate one of these options and hit Control-Alt-Backspace. And (hopefully) there you have it.
Now another word of warning. This process replaces your xorg.conf, so when you make a change to one file you HAVE to make it to the others. Also I have not really tested this, so use it at your own risk.
If what I have written is wrong or is going to break something, would someone please tell me.