There don't seem to be too many resources out there for running dual monitors using the integrated graphics card on a laptop, so I thought I'd do a post on it. This should work for any laptop using the ATI Radeon Mobility M7 graphics controller, and probably any other ATI graphics controllers supporting dual monitors on a single card. I currently use Debian Etch, but this should work with any fairly recent release of X.

I use an IBM Thinkpad T40, which has the usual 15-pin D Sub connector for an external monitor. In Windows, I was always given the option of either duplicating the laptop's display, switching only to the external display, or extending the desktop onto the external display as a dual monitor setup. In Linux, though, I can either run it as a duplicate of the laptop display, or as the only display -- no simple way of selecting it as a second monitor to extend to with Xinerama, etc. Most of the guides for running dual monitors under Linux focus on having two different graphics cards rather than just one that supports a dual monitor setup. The card in the T40, an ATI Radeon Mobility M7, does support dual monitors though. I did manage to find one guide for using dual monitors on the M7 card though:

That guy's xorg.conf file, while intended for a Gateway system, required little modification for use in my system. It doesn't include a proper ServerLayout section though. Here's the clip from my xorg.conf:

This works perfectly with my setup! I modified the second screen specification to run at 1280x1024, the resolution of my external monitor. XFCE is, of course, dual monitor aware, and has no trouble managing it.

There is, however, a problem: things like Google Earth tend to crash the X server when you try to run them in dual monitor mode, at least when using a Radeon Mobility M7 to run both monitors. Also, this is a laptop, so I won't always have dual monitors connected to it. This site suggests a method of switching between the two using Bash aliases and sudo commands. While this works, it's kind've clunky, and requires switching down to a virtual console to switch. There's a simpler way, however, if you use the Gnome Display Manager: I created two shell scripts, stuck them in /usr/local/bin, and made them executable. As suggested in the aforementioned link, they copy one of two alternate xorg.conf files to xorg.conf and reload the display manager with these new settings. This is not on the whole different from the method mentioned, except I then added them as menu items in GDM. You do this by clicking Actions > Configure Display Manager (in GDM itself). You then give the root password, and select the General tab. Click the "Edit Commands" button near the bottom. Drop down the command drop box, and select Custom Command 0 (or higher, if you already have custom commands). Fill out the information, putting the path for one of the switch scripts in there (ex: /usr/local/bin/xsingle for single monitor mode). Repeat with Custom Command 1 for the other option. Now, when you log in under GDM, there will be two options under the Actions menu, for selecting the monitor setup you wish to use. This works out pretty well, since the framebuffer console comes up as duplicating the laptop's screen anyway.

Here's the small script I use to switch to single monitor mode. It copies the single-monitor mode, with the ServerLayout line concerning second screen placement commented out, to xorg.conf: