Dual-headed X11

By | 11 Aug 2008

per user

The native screen-size detection doesn’t work for dual-head installations. To let X11 handle both screens as one large display, find the section Screen in the /etc/X11/xorg.conf and add the following lines:

SubSection "Display"
    Virtual 2560 1024
EndSubSection

This is for two 1280×1024 displays side-by-side (1280+1280 = 2560). Now you can use xrandr to set displays.

xrandr -q

Shows all available displays. Usually it will show the devices VGA-0 and LVDS. To change the output of the external display to be left of the internal LCD panel, use something like

xrandr --output VGA-0 --left-of LVDS

You might also have to use SystemPreferencesScreen Resolution to configure the location of the displays.

Fix screen order

Under Intrepid, it often happens to me that my screenorder is wrong after login. This is shown by a mirrored output on the left display, but the system thinks that there’s a left workspace. On rare occassions, I even have the wrong order (i.e. if I move the mouse to the right on the right workspace, it appears on the left display’s workspace.) This is quickly fixed by switching the order around:

#!/bin/sh
echo Switching position of displays
xrandr --output VGA-0 --right-of LVDS
echo Switching off ext. display
xrandr --output VGA-0 --off
echo Switching back to normal
xrandr --output VGA-0 --mode 1280x1024 --rate 75 --left-of LVDS

After calling the script, my displays are showing the correct workspaces.

system-wide

To configure dual-head system-wide (for Desktop computers), there is a great manual at UbuntuForums.

  1. Use xrandr -q to get the output device’s names (for me it was VGA-0 and DVI-0)
  2. open the /etc/X11/xorg.conf in your favorite editor
  3. find the section Device and add 2 lines so that it looks like this:
    Section "Device"
    Identifier "Configured Video Device"
    Option "monitor-VGA-0" "right"
    Option "monitor-DVI-0" "left"
    EndSection
  4. The device names have to be prefixed with monitor-. The names after that are for you to choose.
  5. find the Monitor section and change the identifier to one of the names. (e.g. right)
  6. add another Monitor section below and change the identifier to the other name. (left) Also add the line Option "LeftOf" "right" in between.
  7. now the both monitor sections should look like this:
    Section "Monitor"
    Identifier "right"
    EndSection

    Section "Monitor"
    Identifier "left"
    Option "LeftOf" "right"
    EndSection
  8. find the Screen section and add the following line to define the default display.
    Monitor "right"
  9. add a SubSection "Display" and the Virtual line as with the per-user configuration
  10. save the file and restart X

Leave a Reply