$ man xorg.conf
The file is divided into sections, each of which looks like this:
Section " SectionName "
Configuration Directives
EndSection
The most commonly used sections in this file are shown in Table 2-3.
Table 2-3. Common xorg.conf section names
Name | Description |
---|---|
Monitor | Monitor specifications. |
InputDevice | Keyboard configuration. |
Pointer device configuration (mice, graphics tablets, touch screens). | |
Device | Video card configuration. |
Screen | Associates a Device with a Monitor and defines the available resolutions and color depth. |
ServerLayout | Associates one or more Screen sections with two or more InputDevice sections. Different ServerLayouts can be defined to combine devices in different ways for use at different times; for example, a laptop can have a ServerLayout that specifies that the internal+external displays should be used, and another one that specifies only the internal display. |
Files | Location of auxiliary files such as fonts, drivers, and color tables. |
ServerFlags | Flags to control the overall operation of the X server. The flags may alternatively be placed in the ServerLayout sections if they apply to some ServerLayouts but not to others. |
Extensions | Enables/disables extensions to the server capabilities. |
Module | Loads additional modules. (Modules may provide extensions, but extensions don't have to exist as separate modules.) |
Modes | Defines special video modes (rarely required). |
DRI | Direct Render Interface (DRI) device configuration, used for some 3-D gaming. |
Here is a typical xorg.conf file:
Section "ServerLayout"
Identifier "single head configuration"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Synaptics" "CorePointer"
InputDevice "Mouse0" "AlwaysCore"
EndSection
Section "Files"
FontPath "unix/:7100"
EndSection
Section "Module"
Load "glx"
Load "dri"
Load "synaptics"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Device" "/dev/input/mice"
Option "Protocol" "IMPS/2"
Option "ZAxisMapping" "4 5" # Scrollwheel support
Option "Emulate3Buttons" "yes" # L+R buttons count as middle
EndSection
Section "InputDevice"
Identifier "Synaptics" # Laptop touchpad
Driver "synaptics"
Option "Device" "/dev/input/mice"
Option "Protocol" "auto-dev"
Option "Emulate3Buttons" "yes"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor" # Just for reference
ModelName "LCD Panel 1400x1050" # Just for reference
HorizSync 31.5 - 90.0 # Horiz. sync in kHz
VertRefresh 59.0 - 75.0 # Vert. refresh in Hz
Option "dpms" # Enables power management
EndSection
Section "Device"
Identifier "Videocard0"
Driver "nv"
VendorName "Videocard vendor" # Just for reference
BoardName "nVidia Corporation NV34M [GeForce FX Go5200]" # Ditto
EndSection
Section "Screen"
Identifier "Screen0"
Device "Videocard0" # Associates the video card
Monitor "Monitor0" # with this monitor
DefaultDepth 24 # Default is 24-bit colour
SubSection "Display"
Viewport 0 0 # "0 0" is almost always used
Depth 24 # This section used by default
Modes "1400x1050" "1280x1024" "1024x768" "800x600" "640x480"
# Change modes with Ctrl-Alt-+/-
EndSubSection
# This next SubSection is not selected by default (because of the
# DefaultDepth line in the previous section). However, it would be used if the
# -depth option was specified on the X server command line,
# overriding the DefaultDepth setting.
SubSection "Display"
Viewport 0 0
Depth 16 # Because default is 24-bit,
Modes "800x600" "640x480" # ...this will usually be ignored
EndSubSection
EndSection
Section "DRI" # Configures DRI devices...
Group 0 # Root (user ID 0) owns them
Mode 0666 # Readable/writable by all
EndSection
Section "Extensions"
Option "Composite" "Enabled" # Enables transparency, etc.
EndSection