This page is out of date. Please use the main navigation to find the latest documentation.

Or "How do I configure a single xorg.conf to handle both Dual Head, Single Head, Projector and other configurations needed for various situations?"

Introduction

Not many are aware that xorg.conf actually supports multiple "setups" in the same file, and even less mess around with it much. Usually, xorg.conf is set up automatically, and is one of those places you'd rather not mess with unless you have to. But I've only seen automatic setups go as far as to create a single, simple Single Head configuration. People with laptops that can do Dual Head, will often have a good reason to tweak xorg.conf to handle multiple setups. I have an extra CRT monitor standing at home and at my university, for instance. When at home, the laptop sits beneath the CRT, and I want a Dual Head with the CRT placed on top of the laptop LCD. When at university, the CRT is by the right, and I want to use Xinerama to allow for greater flexibility (Xinerama excludes DRI on my graphics card, and therefore I want it disabled at home, too.) You may also want to use varying Single Head configurations. I have two of those. One for Single Head on the LCD, and one for Single Head on the VGA (useful if you just want to run a movie on a projector, for instance.)

What follows is first a few comments on other aspects than the xorg.conf itself, and then a heavily commented xorg.conf, explaining my usage of the various Section types. It is intended as a small tutorial in how to set up multiple ServerLayouts (as they are called). It may even be usable as a good template for the modifications to xorg.conf on your gNewSense system. For further, more detailed information about xorg.conf and its various Section types, see http://xorg.freedesktop.org/archive/X11R6.8.0/doc/xorg.conf.5.html

The Ups And Downs Of Multiple Layouts

First. If you like the nice graphical gdm login screen, I have to disappoint you, and say that I do not know how to make multiple ServerLayouts work through gdm. Anyone who does know, please chip in with your knowledge. I myself actually like a plain old text login. But if you want, you can setup a default ServerLayout, which gdm will use, ctrl-alt-F1 to the console, and then start another X with startx -- :1 -layout <layoutname>

It is then possible to change between the two with ctrl-alt-F7 and ctrl-alt-F8. This is very useful in general if, for some reason, you need to use multiple layouts at once. On a standard GNU/Linux gNewSense system, you can change between "displays", as they are called, and consoles with ctrl-alt-Fkey. F1-F6 will usually be tty1-6 (the standard text consoles). F7 and up will be any instances of X you have started. Starting a new X can be done simply by: startx -- :<displaynumber> -layout <layoutname>

As noted above. And you need to specify a new display number for each X you start.

If you can live without gdm, it can be removed from the upstart simply by: update-rc.d -f gdm remove

If later you find that that was a mistake, enable gdm upstart again by: update-rc.d gdm defaults

The sample xorg.conf

What I have commented on here, are the bits of the configuration most interesting for the purpose of creating multiple ServerLayouts. Device, Monitor and Screen sections are briefly explained, while the ServerLayout sections are explained a bit more in-depth.

Together, the Device, Monitor, Screen and ServerLayout sections form a small hierarchy of references. ServerLayout can refer to several Screens, and a Screen can refer to one Monitor and one Device. For example, the "dual" ServerLayout hierarchy looks like this:

ServerLayout dual

Screen LCD

Screen VGA

Device IntelLCD

Monitor LCDMon

Device IntelVGA

Monitor VGAMon

Be aware that this xorg.conf is tailored to my system, so the Device sections, for instance, are set up with the i810 driver, and a driver-specific option "MonitorLayout" that may likely not be available with other drivers. Look to your autoconfigurated xorg.conf and the documentation for your monitor and driver module to find good settings for your setup.

Anyway. Here you can see the actual xorg.conf for yourself:

# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type "man /etc/X11/xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg
Section "Files"
FontPath "/usr/share/X11/fonts/misc"
FontPath "/usr/share/X11/fonts/cyrillic"
FontPath "/usr/share/X11/fonts/100dpi/:unscaled"
FontPath "/usr/share/X11/fonts/75dpi/:unscaled"
FontPath "/usr/share/X11/fonts/Type1"
FontPath "/usr/share/X11/fonts/100dpi"
FontPath "/usr/share/X11/fonts/75dpi"
# path to defoma fonts
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection
# ServerFlags. Applies to the entire config file. Here, I've set the singleLCD ServerLayout as the default.
Section "ServerFlags"
DefaultServerLayout "singleLCD"
EndSection
Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "type1"
Load "vbe"
EndSection
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "dk"
EndSection
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection
# My Device sections. The reason for this is to enable dual screen (IntelLCD and IntelVGA),
# and to use the "MonitorLayout" option of the i810 driver to turn off the LCD
# when using single-screen on the VGA output (IntelVGASingle).
Section "Device"
Identifier "IntelLCD"
Driver "i810"
BusID "PCI:0:2:0"
Screen 0
Option "MonitorLayout" "CRT,LFP"
EndSection
Section "Device"
Identifier "IntelVGA"
Driver "i810"
BusID "PCI:0:2:0"
Screen 1
Option "MonitorLayout" "CRT,LFP"
EndSection
Section "Device"
Identifier "IntelVGASingle"
Driver "i810"
BusID "PCI:0:2:0"
Option "MonitorLayout" "CRT,None"
EndSection
# My monitor sections. One for the LCD on the laptop, and one for the VGA out.
# "VGAMon" was tailored to a Samsung SyncMaster 957MB. Conveniently works with
# the other SyncMaster I use at university.
Section "Monitor"
Identifier "LCDMon"
Option "DPMS"
HorizSync 28-64
VertRefresh 43-60
EndSection
Section "Monitor"
Identifier "VGAMon"
Option "DPMS"
HorizSync 30-96
VertRefresh 50-160
EndSection
# My Screen sections. The Device and Monitor parts refer to the Identifiers
# in the Device and Monitor sections, and define which Device and Monitor
# to use for this particular "virtual screen". I had to define an extra,
# apparantly redundant screen section "VGASingle". This is because I use
# the driver specific "MonitorLayout" to tell the driver how I want to use
# my monitors. Semantically, it would have made more sense to have something
# like "MonitorLayout" down with the "ServerLayout" sections, but that's how
# driver-specific options work. They can only be defined in the Device sections.
# This is something to remember. Driver-specific options can be nice, but they
# also have the potential to force you to make things a bit ugly, if you use
# options that look like they ought to belong somewhere else. But it will
# be unavoidable sometimes.
Section "Screen"
Identifier "LCD"
Device "IntelLCD"
Monitor "LCDMon"
DefaultDepth 24
SubSection "Display"
Depth 16
Modes "1280x768" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x768" "1024x768" "800x600" "640x480"
EndSubSection
EndSection
Section "Screen"
Identifier "VGA"
Device "IntelVGA"
Monitor "VGAMon"
DefaultDepth 24
SubSection "Display"
Depth 16
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
EndSection
Section "Screen"
Identifier "VGASingle"
Device "IntelVGASingle"
Monitor "VGAMon"
DefaultDepth 24
SubSection "Display"
Depth 16
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
EndSection
# This is the best bit. The ServerLayout sections. This is particularly
# useful if you use dual head (either a dual head featured card, or two or more cards
# alongside each other). The Identifier here defines what you need to use for
# the -layout option on startx. I.e.:
# startx -- :0 -layout dual
# To start the "dual" ServerLayout on display 0.
# I will proceed to explain the specifics of my ServerLayout sections.
# This is meant mostly to give you a few examples of how to create ServerLayouts
# that work best for your purposes. These are very specific to my physical monitor
# setups and needs.
# singleLCD. Sometimes, I wont have a second monitor handy, so why waste resources
# on the VGA output? Starts a single screen. Also, I have made it a habit to always define
# the Screen number and coordinates, even if they are most often redundant in single
# head layouts.
Section "ServerLayout"
Identifier "singleLCD"
Screen 0 "LCD" 0 0
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection
# singleVGA. Now, why would I need something like this? Well, in some specific
# situations, I don't want to use the LCD, and then it should be turned off entirely.
# For instance if I hook it up to a projector and want to see a movie, the LCD screen
# is completely unnecessary.
# This is what the "CRT,None" option does for the i810 driver in the extra Device
# section I specified earlier. And the reason for the apparantly redundant Screen section,
# as the Device section is referenced from a Screen section, which is in turn referenced
# from a ServerLayout section.
Section "ServerLayout"
Identifier "singleVGA"
Screen 1 "VGASingle" 0 0
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection
# dual. This may be more interesting for dual head users. I know it is possible to define
# such things as RightOf, LeftOf, and so on. But I find it easier to just define the coordinates
# on my "virtual" workspace.
# Here, my VGA is set on coordinates (0, 0). Remember, this refers to the upper left corner
# of the screen. My VGA is at 1280x1024, and so, my LCD is set on coordinates (0, 1024), which
# means it will be located right beneath my VGA. This is a nice setup at home for me. In this
# case, I do not use Xinerama, as the GMA950 doesn't seem to support DRI with Xinerama at all.
# I don't have a great need to move stuff between screens when I'm home though, so it's okay.
# Also, per default, DRI only runs on the LCD, but it should be changeable with the Option "DRI"
# in the Device section. (I haven't tried, but possibly, you could disable it for the LCD and then
# enable it for the VGA to change it).
Section "ServerLayout"
Identifier "dual"
Screen 0 "LCD" 0 1024
Screen 1 "VGA" 0 0
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection
# dualuni. The setup I use at university. Here, the monitor is placed to the right of my monitor,
# and I enable Xinerama. I don't need DRI at university, and being able to move things around
# between monitors can be immensely useful when the monitors aren't placed on top of each other.
# Note that while the x resolution matches for the "dual" layout, the y resolution is unmatched,
# because the LCD is in 16:9, and has a resolution of 1280x768.
# I have set it up here, so that the bottom of the two Screens match up.
Section "ServerLayout"
Identifier "dualuni"
Screen 0 "LCD" 0 256
Screen 1 "VGA" 1280 0
Option "Xinerama" "true"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection
Section "DRI"
Mode 0666
EndSection