Multiple monitors with xrandr

Submitted by ormiret on Mon, 14/01/2008 - 13:36.

This way is a lot easier than the messing with xorg.conf I used to have to do for presentations and works well enough that I can add another monitor to my laptop whenever one is available (without even restarting X!).

I needed to make two change to the xorg.conf I got as default in Ubuntu Gutsy: change from the i810 driver to the intel one, and add a line to increase the maximum size of the two displays. This makes the Section "Screen" look like:

Section "Screen"
	Identifier	"Default Screen"
	Device		"Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller"
	Monitor		"Generic Monitor"
	DefaultDepth	24
	SubSection "Display"
		   Depth 24
		   Modes   "1280x800"
		   Virtual 2560 1824
	EndSubSection
EndSection

The Virtual line is the important bit. This isn't needed if you just want to mirror the internal screen to the external display, and the default for some drivers might be big enough without being changed.

Once that is done (and X has been restarted to pick it up) running xrandr will give a list of outputs and what modes it thinks will work with the devices attached to them.

I want to have the external display be a second monitor above the internal display and this is done by:

xrandr --output VGA --mode 1280x1024

to switch the output on and pick a resolution, then

xrandr --output VGA --above LVDS

to give it a position.

( categories: )