xorg.conf

While there is rarely a need to manually edit the /etc/X11/xorg.conf file, it is useful to understand the various sections and optional parameters available, especially when troubleshooting.

The Structure

The /etc/X11/xorg.conf file is comprised of many different sections which address specific aspects of the system hardware.

Each section begins with a Article "<section-name>" line (where <section-name> is the title for the section) and ends with an EndArticle line. Each section contains lines that include option names and one or more option values. These are sometimes enclosed in double quotes (").

Lines beginning with a hash mark (#) are not read by the X server and are used for human-readable comments.

Some options within the /etc/X11/xorg.conf file accept a boolean switch which turns the feature on or off. Acceptable boolean values are:

The following are some of the more important sections in the order in which they appear in a typical /etc/X11/xorg.conf file. More detailed information about the X server configuration file can be found in the xorg.conf man page.

ServerFlags

The optional ServerFlags section contains miscellaneous global X server settings. Any settings in this section may be overridden by options placed in the ServerLayout section (refer to for details).

Each entry within the ServerFlags section is on its own line and begins with the term Option followed by an option enclosed in double quotation marks (").

The following is a sample ServerFlags section:

Article "ServerFlags"
 Option "DontZap" "true"
EndArticle

The following lists some of the most useful options:

ServerLayout

The ServerLayout section binds together the input and output devices controlled by the X server. At a minimum, this section must specify one output device and one input device. By default, a monitor (output device) and keyboard (input device) are specified.

The following example illustrates a typical ServerLayout section:

Article  "ServerLayout"
 Identifier     "Default Layout"
 Screen      0  "Screen0" 0 0
 InputDevice    "Mouse0" "CorePointer"
 InputDevice    "Keyboard0" "CoreKeyboard"
EndArticle

The following entries are commonly used in the ServerLayout section:

It is possible to put more than one ServerLayout section in the /etc/X11/xorg.conf file. By default, the server only reads the first one it encounters, however.

If there is an alternative ServerLayout section, it can be specified as a command line argument when starting an X session.

Files

The Files section sets paths for services vital to the X server, such as the font path. This is an optional section, these paths are normally detected automatically. This section may be used to override any automatically detected defaults.

The following example illustrates a typical Files section:

Article "Files"
 RgbPath      "/usr/share/X11/rgb.txt"
 FontPath     "unix/:7100"
EndArticle

The following entries are commonly used in the Files section:

Module

By default, the X server automatically loads the following modules from the /usr/lib/xorg/modules/ directory:

The default directory for loading these modules can be changed by specifying a different directory with the optional ModulePath parameter in the Files section. Refer to for more information on this section.

Adding a Module section to /etc/X11/xorg.conf instructs the X server to load the modules listed in this section instead of the default modules.

For example, the following typical Module section:

Article "Module"
 Load  "fbdevhw"
EndArticle
instructs the X server to load the fbdevhw instead of the default modules.

As such, if you add a Module section to /etc/X11/xorg.conf, you will need to specify any default modules you want to load as well as any extra modules.

InputDevice

Each InputDevice section configures one input device for the X server. Systems typically have at least one InputDevice section for the keyboard. It is perfectly normal to have no entry for a mouse, as most mouse settings are automatically detected.

The following example illustrates a typical InputDevice section for a keyboard:

Article "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
EndArticle

The following entries are commonly used in the InputDevice section:

Consult the xorg.conf man page for a list of valid options for this section.

Monitor

Each Monitor section configures one type of monitor used by the system. This is an optional entry as well, as most monitors are now automatically detected.

The easiest way to configure a monitor is to configure X during the installation process or by using the X Configuration Tool. For more information about using the X Configuration Tool, refer to .

This example illustrates a typical Monitor section for a monitor:

Article "Monitor"
 Identifier   "Monitor0"
 VendorName   "Monitor Vendor"
 ModelName    "DDC Probed Monitor - ViewSonic G773-2"
 DisplaySize  320 240
 HorizSync    30.0 - 70.0
 VertRefresh  50.0 - 180.0
EndArticle

Be careful when manually editing values in the Monitor section of /etc/X11/xorg.conf. Inappropriate values can damage or destroy a monitor. Consult the monitor's documentation for a listing of safe operating parameters.

The following are commonly entries used in the Monitor section:

Device

Each Device section configures one video card on the system. While one Device section is the minimum, additional instances may occur for each video card installed on the machine.

The best way to configure a video card is to configure X during the installation process or by using the X Configuration Tool. For more about using the X Configuration Tool, refer to .

The following example illustrates a typical Device section for a video card:

Article "Device"
 Identifier  "Videocard0"
 Driver      "mga"
 VendorName  "Videocard vendor"
 BoardName   "Matrox Millennium G200"
 VideoRam    8192
 Option      "dpms"
EndArticle

The following entries are commonly used in the Device section:

Screen

Each Screen section binds one video card (or video card head) to one monitor by referencing the Device section and the Monitor section for each. While one Screen section is the minimum, additional instances may occur for each video card and monitor combination present on the machine.

The following example illustrates a typical Screen section:

Article "Screen"
 Identifier "Screen0"
 Device     "Videocard0"
 Monitor    "Monitor0"
 DefaultDepth     16
 SubArticle "Display"
  Depth     24
  Modes    "1280x1024" "1280x960" "1152x864" "1024x768" "800x600" "640x480"
 EndSubArticle
 SubArticle "Display"
  Depth     16
  Modes    "1152x864" "1024x768" "800x600" "640x480"
 EndSubArticle
EndArticle

The following entries are commonly used in the Screen section:

DRI

The optional DRI section specifies parameters for the Direct Rendering Infrastructure (DRI). DRI is an interface which allows 3D software applications to take advantage of 3D hardware acceleration capabilities built into most modern video hardware. In addition, DRI can improve 2D performance via hardware acceleration, if supported by the video card driver.

This section rarely appears, as the DRI Group and Mode are automatically initialized to default values. If a different Group or Mode is desired, then adding this section to the xorg.conf file will override those defaults.

The following example illustrates a typical DRI section:

Article "DRI"
 Group        0
 Mode         0666
EndArticle

Since different video cards use DRI in different ways, do not add to this section without first referring to .