I recently bought an LCD monitor, but wanted to keep using my CRT as an auxiliary display. The LCD is central on my desk, and the CRT off to the left. I have a single graphics card, an Nvidia 6600, which has VGA and DVI outputs (the DVI to my LCD monitor, the VGA to the CRT). Here are sections of my xorg.conf file, with explanations. Make a backup of your working file so that you can revert, if you’re going to modify it. As usual, the following is applicable to Ubuntu; there may be minor differences if you’re on a different setup.

Xtrap

Section "Module"
...
Load "xtrap"
EndSection

Add xtrap to your modules section, if it isn’t there already. This allows the mouse cursor to make the jump between screens.

2 Devices

Section "Device"
Identifier "NVIDIA0"
Driver "nvidia"
Option "IgnoreEDID" "on"
Option "UseDisplayDevice" "DFP"
Screen 0
BusID "PCI:1:0:0"
EndSection

Section "Device"
Identifier "NVIDIA1"
Driver "nvidia"
Option "IgnoreEDID" "on"
Option "UseDisplayDevice" "CRT"
Screen 1
BusID "PCI:1:0:0"
EndSection

Even though I have only one card, I need to define two devices. The driver is “nvidia” rather than “nv”, because the latter (open source) driver unfortunately didn’t cut it in the dual head setup. Within the “Device” section, you associate a Screen number with the device; 0 is the primary screen (i.e. the screen that GDM or KDM will use), 1 the secondary, and so on. By default, the VGA port is also primary; that’s why I’m using the very useful nvidia option: UseDisplayDevice. (DFP stands for DVI / Flat Panel; you can only use it with flat panel monitors.) The Identifiers, naturally, are up to you - they are just something meaningful that you can refer to later in the configuration.

2 Monitors

Section "Monitor"
Identifier "Monitor CRT"
Option "DPMS"
HorizSync 28-90
VertRefresh 43-150
EndSection

Section "Monitor"
Identifier "Monitor LCD"
Option "DPMS"
HorizSync 28-72
VertRefresh 43-60
EndSection

Here are the monitor configurations. There’s really no magic here. Just make sure you pick sync/refresh rates applicable to your monitor. (If you don’t know valid values, you can plug the monitor into the CRT on your card, and run through sudo dpkg-reconfigure xserver-xorg, which will generate/overwrite xorg.conf with applicable configuration; alternatively try searching google for xorg {your monitor make/model}.)

2 Screens

Section "Screen"
Identifier "Screen LCD"
Device "NVIDIA0"
Monitor "Monitor LCD"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1440x900" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Section "Screen"
Identifier "Screen CRT"
Device "NVIDIA1"
Monitor "Monitor CRT"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Here you are tying together your device and monitor configurations, and setting the valid resolutions/depths that are applicable. Again this is perhaps something that you might want to previously autogenerate, and then copy and paste into the new configuration.

The Layout

Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Screen LCD" 0 0
Screen 1 "Screen CRT" LeftOf "Screen LCD"
Option "xinerama" "on"
...
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection

Here’s the main piece. As I understand it, xorg will read this first, and then try to resolve everything in the configuration. Screen 0 and 1 are the same numbers you had in the Devices section; the screen names are the Identifiers from the Screens section. Then, you also define the input devices (in my case, keyboard and mouse) which are configured elsewhere in your configuration.

The “0 0″ on the Screen 0 line is called “x, y” in the xorg manual. I assume that this would be useful if you are building an NxN monitor display. LeftOf is fairly obvious; you tell X where the monitors physically are (you can also use RightOf, and also other constants for vertical reference, which you can look up yourself.)

Without the xinerama line, you will have two entirely seperate desktops; i.e. two mostly independent KDEs or Gnomes. This is not seamless, however; also, you will find that you can’t drag windows between the monitors. This is where xinerama comes in; effectively, it makes your monitors behave like one giant desktop, *even if* they are different sizes and/or resolutions. It is a lot smarter than the windows parallel; fullscreen, e.g., confines itself to one monitor; the KDE panel knows about each monitor, so you can drag it to your main monitor, and it will stay there (and not show on the second one).

Post any questions you have in the comments section, and I’ll do my best to help you out (or will at least point you in the right direction).



Related Comments (6)