I've wanted to get dual monitor support working for some time, and I was pretty sure that my hardware would support it. I have a Thinkpad T60p with a Mini Dock. I bought my T60p almost two years ago in a retail store (as opposed to directly from Lenovo), so it has some non-standard hardware, such as the ATI FireGL video cards.
$ sudo apt-get install envyng-gtk
You'll find the Envy program in your menu's under Applications / System Tools. Run EnvyNG. Select ATI or NVIDIA, then install the driver.
$ sudo dpkg-reconfigure -phigh xserver-xorg
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
+ SubSection "Display"
+ Depth 24
+ Virtual 3360 1050
+ EndSubSection
EndSection
You'll need to restart X Windows. You can reboot now, but I prefer to use CTRL-ALT-BACKSPACE to just restart X and re-login.
Now that you know the displays, you can use xrandr to enable or disable them.
I created a simple shell batch file to enable dual monitor support. You could create a similar script and put it in your /etc/init.d directory, but since this is a mobile laptop, that isn't always connected to the external monitors, I choose to just type a command when I want the dual monitors.
#~!/bin/sh
xrandr -q | grep VGA-0 > /dev/null 2>&1
if [ $? -eq 0 ]; then
xrandr --output LVDS --off
xrandr --output DVI-0 --mode 1680x1050 --auto --output VGA-0 --mode 1680x1050 --auto --left-of DVI-0
fi
Run the shell script and you should now have two desktops!. You probably have a different video card than me. So you may need to play with the Virtual desktop size and the resolution in the shell script, to find what works best for you.
I manually switched the desktop by right-clicking on the desktop, adding the new image as a background, then selecting it. Once the image is added once, I'm sure that there's a way to automate this in the script, but I haven't done that yet.
And there it is! If this doesn't help anyone else, at least I've documented what I did, so I'll be able to do it again.