cybernightlife [e-mail] [forums] [home] [return]

The X.org Configuration File Explained

The /etc/X11/xorg.conf is one of the most important core files on any of today's Linux/UNIX distributions. This is the configuration file for the X Window System. It tells Linux what hardware drivers to load, and how to setup those drivers in order to setup the graphical display, and what resolution to use for the graphical display.

The X Window System is one of the most essential pieces of software for any Linux/UNIX system (outside of Mac OS-X, that is). Without the X Window System, you cannot launch any desktop environment, let alone any home and small business applications.

This page was written to explain the contents of this important file. As shipped by MEPIS, this configuration file is optimized to work on as many systems as possible, so you can get your system up and running as quickly as possible.

Because of this, you will get a minimal configuration for your desktop. This depends upon your video card and monitor installed. For example, MEPIS defaults to 1024 x 768 x 16-bit color displays when used with a nVidia GeForce MX400 card, and a flat-panel display (a Gateway FPD1510).

Editing /etc/X11/xorg.conf

MEPIS recommends you use the System Configuration utility. Simply click on the gears icon on the KDE panel, then select System Configuration (settings) from the menu. When the settings dialog appears, select System Administration, then select MEPIS Utilities, and enter your system administration password.

You can use any text editor to edit /etc/X11/xorg.conf, but editing this file requires system administration privileges. I will show you which settings you can safely change, and to what values. Get any of these settings wrong, and you could render your SimplyMEPIS system unusable.

The example file shown here is for a Gateway 700S machine as shipped from the factory, i.e. with a FPD1510 flat panel display connected with a hDVI cable to a nVidia GeForce MX400 video card. The keyboard is a Gateway Millenium II (a rebranded Silitek Corporation SK9920), and the mouse is a Logitech USB optical mouse (Gateway branded).

Section "ServerLayout"
  Identifier "XFree86 Configured"
  Screen 0 "Screen0" 0 0
 #Screen 0 "ATIScreen" 0 0
  InputDevice "Keyboard0" "CoreKeyboard"
  InputDevice "PS/2 Mouse" "CorePointer"
 #InputDevice "USB Mouse" "CorePointer"
 #InputDevice "Touchpad" "CorePointer"
 #InputDevice "Stylus" "CorePointer"
 #InputDevice "Eraser" "CorePointer"
 #InputDevice "Cursor" "CorePointer"
 #InputDevice "Serial Mouse" "CorePointer"
EndSection

Section "ServerFlags"
  Option "AllowMouseOpenFail" "true"
EndSection

Do not change any of these settings here. SimplyMEPIS has detected you hardware and configured these settings for your machine.

Though I have a USB mouse, the configuration file is set correctly for this machine. The X Window System treats the Logitech USB mouse the same as any PS/2 connected mouse.

The ATIScreen here would be set if you have a newer ATI video card and the commercial ATI driver installed from the included MEPIS-specific configuration utility.

The AllowMouseOpenFail setting ensures that you will get a desktop whether the mouse works or not.

Section "Files"
# Xorg 7.0 font paths
    FontPath 	"/usr/share/X11/fonts/misc:unscaled"
    FontPath 	"/usr/share/X11/fonts/cyrillic"
    FontPath 	"/usr/share/X11/fonts/Type1"
    FontPath 	"/usr/share/X11/fonts/util"

# Legacy font paths
    FontPath 	"/usr/X11R6/lib/X11/fonts/misc:unscaled"
    FontPath 	"/usr/X11R6/lib/X11/fonts/cyrillic"
    FontPath 	"/usr/X11R6/lib/X11/fonts/Type1"
    FontPath 	"/usr/X11R6/lib/X11/fonts/util"

# Other font paths
    FontPath 	"/usr/share/fonts/truetype/ttf-lucida"
    FontPath 	"/usr/share/fonts/truetype/arphic"
    FontPath 	"/usr/share/fonts/truetype/freefont"
    FontPath 	"/usr/share/fonts/truetype/kochi"
    FontPath 	"/usr/share/fonts/truetype/latex-xft-fonts"
    FontPath 	"/usr/share/fonts/truetype/openoffice"
    FontPath 	"/usr/share/fonts/truetype/ttf-bitstream-vera"
    FontPath 	"/usr/share/fonts/type1/gsfonts"
    FontPath 	"/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
    FontPath 	"/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"

EndSection

This section is very much self-explanatory, and tells the X Window System where to find the fonts on your system. Do not change any of these settings unless you know what you are doing, and you have fonts installed somewhere else in your system.

Section "Module"
  Load "GLcore"
  Load "bitmap"
  Load "dbe"
  Load "ddc"
  Load "dri"
  Load "extmod"
  Load "freetype"
  Load "glx"
  Load "int10"
  Load "record"
  Load "type1"
  Load "v4l"
  Load "vbe"
  Load "synaptics"
EndSection

This section tells which software modules to load for your system configuration. Again, MEPIS has determined these to be optimal for your system. The GLcore, bitmap, dbe, ddc, dri, extmod, freetype, glx, int10, record, type1, and vbe are all essential to the operation of the X Window System, and should never be disabled for any reason.

You can disable the v4l driver if you never plan to use a webcam or other hardware video device on your system. The synaptics driver can be disabled if you do not have, or will never intend to use a Synaptics Touch Pad on your system.

InputDevice Statements

Section "InputDevice"
  Identifier "Keyboard0"
  Driver "keyboard"
  Option "CoreKeyboard"
  Option "XkbModel" "pc105"
  Option "XkbLayout" "us"
  Option "XKbOptions" ""
EndSection

Section "InputDevice"
  Identifier "Serial Mouse"
  Driver "mouse"
  Option  "Protocol" "Microsoft"
  Option  "Device" "/dev/ttyS0"
  Option  "Emulate3Buttons" "false"
  Option  "Emulate3Timeout" "70"
EndSection

Section "InputDevice"
 Identifier "Touchpad"
 Driver "synaptics"
 Option "Device" "/dev/psaux"
 Option "Protocol" "auto-dev"
 Option "LeftEdge" "1700"
 Option "RightEdge" "5300"
 Option "TopEdge" "1700"
 Option "BottomEdge" "4200"
 Option "FingerLow" "25"
 Option "FingerHigh" "30"
 Option "MaxTapTime" "180"
 Option "MaxTapMove" "220"
 Option "VertScrollDelta" "100"
 Option "MinSpeed" "0.06"
 Option "MaxSpeed" "0.12"
 Option "AccelFactor" "0.0010"
 Option "SHMConfig" "on"
 Option "Repeater" "/dev/input/mice"
EndSection

Section "InputDevice"
  Identifier "PS/2 Mouse"
  Driver "mouse"
  Option "Protocol" "auto"
  Option "Device" "/dev/psaux"
  Option "Emulate3Buttons" "false"
  Option "Emulate3Timeout" "70"
  Option "ZAxisMapping" "4 5"
  Option "Buttons" "5"
EndSection

Section "InputDevice"
  Identifier "USB Mouse"
  Driver "mouse"
  Option "Device" "/dev/input/mice"
  Option "Protocol" "ExplorerPS/2"
  Option "ZAxisMapping" "4 5"
  Option "Buttons" "5"
EndSection

Section "InputDevice"
  Identifier "Stylus"
  Driver "wacom"
  Option "Mode" "Absolute"
  Option "Type" "stylus"
  Option "Device" "/dev/input/wacom"
Endsection

# Settings for wacom eraser
Section "InputDevice"
  Identifier "Eraser"
  Driver "wacom"
  Option "Mode" "Absolute"
  Option "Type" "eraser"
  Option "Device" "/dev/input/wacom"
Endsection
# Settings for wacom cursor (mouse)
Section "InputDevice"
  Identifier "Cursor"
  Driver "wacom"
  Option "Mode" "Absolute"
  Option "Type" "cursor"
  Option "Device" "/dev/input/wacom"
Endsection

These InputDevice sections are configured for any input devices, such as touchpads, mice, keyboards, that you may have plugged in to your system.

Here, some items can be changed safely. Your xorg.conf does contain more than one InputDevice section. This allows for all of your input devices to be configured for use with the X Window System. At the bare minimum, InputDevice sections for your keyboard and mouse must be included.

A Identifier line and a Driver line is a bare minimum for each InputDevice section. The Identifier line is a label that tells the X Window System that there is an input device that can be used, and Identifier is what that device is known by. The Driver line tells the X Window System what driver to use for that device.

Extra information is needed to tell the X Window System how to configure the drivers and how to handle the device. This is where the Option statements come in.

Obviously, X needs to know where your devices are plugged into. The keyboard and mouse have default locations. On MEPIS, /dev/input/event0 is the device name for keyboard events, whether you are using a PS/2, an older AT or a USB keyboard.

The mouse, on the other hand, is not so obvious. /dev/input/mouse0 works with all PS/2 and USB mice. /dev/psaux works only with PS/2 mice. If you have an older mouse that plugs into a serial port, you will need to supply an Option "Device" statement containing the name of the serial port your mouse is connected to, e.g. /dev/ttyS0 for the first detected serial port.

MEPIS should be able to detect most hardware. However, older devices, especially those connected to serial ports, are more often than not not detected. Hence the inclusion of statements like these:

Section "InputDevice"
  Identifier "Serial Mouse"
  Driver "mouse"
  Option  "Protocol" "Microsoft"
  Option  "Device" "/dev/ttyS0"
  Option  "Emulate3Buttons" "false"
  Option  "Emulate3Timeout" "70"
EndSection

is necessary for older serial mice to be used with MEPIS.

As you can see, some devices require lots of options and some only require one or two options.

Monitor

This section tells the X Window System about the characteristics of the display connected to your system. MEPIS has optimized this to work with any monitor you attach to your video card, hence the conservative settings. While this may be overwhelming to view, it is also very important that these settings be correct!

Strong Warning: The settings here are very technical in nature, and should NEVER be changed unless you absolutely know what you are doing. While newer displays can protect themselves against what we call overdriving, i.e. the video card will attempt to refresh the display at a rate faster than what the display can handle, such overdriving on older monitors will cause those monitors to literally fry themselves and BE DAMAGED BEYOND REPAIR.

My advice here is to use the MEPIS configuration utility to change the monitor settings. The following is for informational purposes only, and has been proven to work with any monitor. Do not change ANY of the numbers on the Modelines in your configuration file.

Section "Monitor"
  Identifier "Monitor0"
  VendorName "unknown"
  ModelName "unknown"
 #Option "DPMS" "true"
  HorizSync    30.0 - 75.0 # Warning: This may fry old Monitors
  VertRefresh  50.0 - 70.0 # Very conservative. May flicker.
  Modeline "640x480"     25.175 640  664  760  800   480  491  493  525 #60Hz
  Modeline "800x600"     40.12  800  848  968 1056   600  601  605  628 #60Hz
  Modeline "1024x768"    75    1024 1048 1184 1328   768  771  777  806 -hsync -vsync
  Modeline "1024x768"    85    1024 1056 1152 1360   768  784  787  823
  ModeLine "1152x864"    65    1152 1168 1384 1480   864  865  875  985 Interlace
  Modeline "1152x864"    92    1152 1208 1368 1474   864  865  875  895
  Modeline "1152x864"   110    1152 1240 1324 1552   864  864  876  908
  Modeline "1152x864"   135    1152 1464 1592 1776   864  864  876  908
  Modeline "1152x864"   137.65 1152 1184 1312 1536   864  866  885  902 -HSync -VSync
  Modeline "1280x768"    80.14 1280 1344 1480 1680   768  769  772  795
  ModeLine "1280x800"    80.58 1280 1344 1480 1680   800  801  804  827 -HSync -VSync
  Modeline "1280x1024"   80    1280 1296 1512 1568  1024 1025 1037 1165 Interlace
  Modeline "1280x1024"  110    1280 1328 1512 1712  1024 1025 1028 1054
  Modeline "1280x1024"  126.5  1280 1312 1472 1696  1024 1032 1040 1068 -HSync -VSync
  Modeline "1280x1024"  135    1280 1312 1456 1712  1024 1027 1030 1064
  Modeline "1280x1024"  135    1280 1312 1416 1664  1024 1027 1030 1064
  Modeline "1280x1024"  157.5  1280 1344 1504 1728  1024 1025 1028 1072 +HSync +VSync
  Modeline "1280x1024"  181.75 1280 1312 1440 1696  1024 1031 1046 1072 -HSync -VSync
  Modeline "1440x900"   106.47 1440 1520 1672 1904   900  901  904  932 +HSync +VSync
  Modeline "1400x1050"  129    1400 1464 1656 1960  1050 1051 1054 1100 +HSync +VSync
  Modeline "1600x1200"  162    1600 1664 1856 2160  1200 1201 1204 1250 +HSync +VSync
  Modeline "1600x1200"  189    1600 1664 1856 2160  1200 1201 1204 1250 -HSync -VSync
  Modeline "1600x1200"  202.5  1600 1664 1856 2160  1200 1201 1204 1250 +HSync +VSync
  Modeline "1600x1200"  220    1600 1616 1808 2080  1200 1204 1207 1244 +HSync +VSync
  Modeline "1680x1050"  147.14 1680 1784 1968 2256  1050 1051 1054 1087
  ModeLine "1800x1440"  230    1800 1896 2088 2392  1440 1441 1444 1490 +HSync +VSync
  ModeLine "1800x1440"  250    1800 1896 2088 2392  1440 1441 1444 1490 +HSync +VSync
  Modeline "1920x1200"  230    1920 1936 2096 2528  1200 1201 1204 1250 +HSync +VSync
EndSection

Section "Monitor"
  Identifier  "ATIMonitor"
  VendorName "unknown"
  ModelName "unknown"
 #Option "DPMS" "true"
  HorizSync    30.0 - 75.0 # Warning: This may fry old Monitors
  VertRefresh  50.0 - 70.0 # Very conservative. May flicker.
EndSection

X Window System uses these lines to determine what screen resolution(s) you can use for your monitor and video display.

There is a Option line for DPMS. You can set this line (remove the #) only if your monitor supports the Display Power Management System specification.

The Device Section

Obviously the X Window System needs to know what video card you have installed on your machine.

The Device statement supplies the details and is configured by MEPIS for your hardware. Notice the numerous Options statements required to get a video display working on MEPIS.

Section "Device"
  Identifier  "Card0"
  Driver "nv"
  BoardName "unknown"

 #BusID  "PCI:1:0:0"
 #Option "sw_cursor" # needed for some ati cards
 #Option "hw_cursor"
 #Option "NoAccel"
 #Option "ShowCache"
 #Option "ShadowFB"
 #Option "UseFBDev"
 #Option "Rotate"
  Option "UseInternalAGPGART" "no"

# savage special options, use with care
 #Option "NoUseBios"
 #Option "BusType" "PCI"
  Option "DmaMode" "None"

# nvidia special options, use with care
  Option "CursorShadow" "1"
  Option "CursorShadowAlpha" "63"
  Option "CursorShadowYOffset" "2"
  Option "CursorShadowXOffset" "4"
  Option "FlatPanelProperties" "Scaling = native"
  Option "NoLogo" "false"
  Option "IgnoreEdid" "true" # needs to be true for some nvidia cards
EndSection

The PCI information is shown here, but ignored by X as that information is automatically detected when X is launched.

The Difference between nv and nvidia

In the Linux world, there are two video drivers that work with nVidia-based video cards, the open source nv driver, and the commercial nvidia driver.

The main difference between these drivers is that the commercial driver utilizes the 3D acceleration features of your video card, of which nVidia keeps proprietary. The open source driver can only be used with standard video displays.

If your video card has a nDVI connectors, the commercial driver will not work with this connectors, unless the Option "TwinView" "true" statement is present. Only the VGA port is usable with the commercial driver.

Likewise, the S-Video connector will only work with the commercial driver installed.

To use the commercial driver, simply install the latest version and configure your options using the MEPIS configuration utility, and reboot your system.

The Screen Section

This is where it all happens. Look at the Device and Monitor statements. Recognize the values in quotation marks. They should be exactly the same as the Identifier statements in their respective sections. This is what the X Window System uses to configure your video card and monitor.

Note the next line. By default, MEPIS sets the DefaultColorDepth to 16 for 16-bit color. You can change this to 24 or 32 if your video card can handle 24 or 32-bit color displays. In this example, The nVidia GeForce MX400 can handle 24-bit color displays, hence the change in this setting.

You can change this to 8 for 8-bit color, but this is only recommended for ancient video cards that can handle only the standard VGA or SuperVGA display modes. Most modern video boards should be able to handle 24 or 32-bit color modes.

Section "Screen"
  Identifier "Screen0"
  Device "Card0"
  Monitor "Monitor0"
  DefaultColorDepth 24
  
  SubSection "Display"
  Depth 8
  Modes "1024x768" "800x600" "640x480"
  EndSubSection
  SubSection "Display"
  Depth 15
  Modes "1024x768" "800x600" "640x480"
  EndSubSection
  SubSection "Display"
  Depth 16
  Modes "1024x768" "800x600" "640x480"
  EndSubSection
  SubSection "Display"
  Depth 24
  Modes "1024x768" "800x600" "640x480"
  EndSubSection
  SubSection "Display"
  Depth 32
  Modes "1024x768" "800x600" "640x480"
  EndSubSection
  
  # Only the official NVIDIA driver supports twinview
  # these setting are an example
  Option "TwinView" "false"
  Option "SecondMonitorVendorName" "unknown"
  Option "SecondMonitorModelName" "unknown"
  Option "SecondMonitorHorizSync" "30-75"
  Option "SecondMonitorVertRefresh" "50-70"
 #Option "MetaModes" "1024x768, 1024x768"
  Option "TwinViewOrientation" "RightOf"
  Option "ConnectedMonitor" "dfp,dfp"
EndSection

Section "Screen"
  Identifier "ATIScreen"
  Device "Card0"
  Monitor "ATIMonitor"
  DefaultColorDepth 24
  
  SubSection "Display"
  Depth 24
  Modes "1024x768" "800x600" "640x480"
  EndSubSection
EndSection

...and finally


Section "DRI"
  Mode 0666
EndSection

DRI stands for Direct Rendering Interface, and has to do with the methods used for rendering graphics on displays. In DRI, rather than using separate memory to render graphical elements, the video driver does the rendering directly in the video memory, enhancing performance of the video driver.

This section should be left alone. Changing the Mode here will cause performance problems for your display, or worse causing X to fail to start.

Trademarks Acknowledged

  • SimplyMEPIS and MEPIS are registered trademarks of MEPIS, LLC
  • Linux is a registered trademark of Linus Torvalds
  • Ubuntu and Kubuntu are registered trademarks of Canonical, Inc
  • Debian is a registered trademark of Software for the Public Interest
  • Mac OS-X is a registered trademark of Apple Computer
  • Gateway is a registered trademark of Gateway, Inc
  • nVidia and GeForce are registered trademarks of nVidia Corporation
  • Logitech is a registered trademark of Logitech, Inc.
  • all other trademarks are properties of their respective owners

Copyright 1996-2007 Patrick G Horneker.
Distributed under Free Documentation License, because the greatest enemy we have in this world is ignorance.