The XF86Config File

The XF86Config file is used to properly feed font, keyboard, mouse, video chipset, moni­tor capabilities, and color depth setting information to your selected X11 display server. XF86Config is a single text file that consists of several sections that are summarized in Table 3.2.

You can page through your system's XF86Config file by using the less command (dis­cussed in Hour 4, "Reading and Navigation Commands"). At the command line of a ter­minal, use less, followed by the path to XF86Config, like this:

# less /etc/XF86Config

You can then use the cursor keys to browse through the file. Press the Q key when you finish reading.

Table 3.2   Major Sections of the XF86Config File




Module ServerFlags

Keyboard Pointer Xinput Monitor

Device Screen

Tells the X server where colors, fonts, or specific software modules are located

Tells the X server what special modules should be loaded

Contains on/off flags to enable or deny special actions, such as core dumps , keyboard server shutdown , video-mode switching , video tun­ing , and mouse and keyboard configuration

Tells the X server what keyboard to expect and what settings to use

Tells the X server what pointer to use and how buttons are handled

Special section for devices, such as graphics pads , styli, and so on

Specifies details and settings for your monitor , such as name, horizontal sync ranges , vertical sync ranges , and modelines (one for each video resolution , such as 640x480, 800x600, 1024x768, and so on)

Provides details about your video chipset , such as RAM , clockchips , and so on

Specifies what X server to use, the color depth (such as 8-, 16-, 24-, or 32-bits per pixel), screen size (such as 640x480, 800x600, 1024x768, and so on), and the size of the virtual screenDo not use an XF86Config from someone who does not have the same graphics card and monitor as you! Incorrect settings can damage your moni­tor. Do not use monitor settings outside you monitor's specifications . You have been warned! The only exception to this rule might be for PC note­book users with exactly the same components.

Before you try to start an X11 session using your new XF86Config settings , as the root operator , open the file in your favorite text editor , disable line wrapping , and check the settings. It is essential, especially for laptop users , to do this to check the created set­tings, enable or disable some X server options , enter the correct amount of video mem­ory , and fine-tune monitor settings.

The XF86Config Files Section

The Files section tells the X server the location of the color name database and system fonts .

The XF86Config ServerFlags Section

Several parts of this section can be used to configure special actions enabled by your XFree86 X server . Enable a particular action by removing the pound sign (#) in front of the specific flag. Most users do not disable the DontZap feature because it provides a quick way to exit an X session. The DontZoom feature can be disabled if you use X in only one video resolution, such as 800x600 pixels.

The XF86Config Keyboard Section

The Keyboard section tells the X server what type of keyboard to expect and settings to use, such as language type , key character layout , and manufacturer.

The XF86Config Pointer Section

The Pointer section tells the X server what pointer, or mouse, to use and how the buttons are handled. Some Protocol settings are Auto for a serial mouse and BusMouse for a bus mouse. The Device entry, /dev/mouse, is a symbolic link to the actual device (such as /dev/ttys0 for a serial mouse).

Two-button mouse users definitely want to enable the three-button emula­tor , in which simultaneously depressing both buttons simulates pressing the middle button, or button 2. one common use of button 2 is to paste text or graphics. For more information about configuring a mouse, see the file README.mouse under the /usr/X11R6/lib/X11/doc directory.The XF86Config Monitor Section

Although the first several parts of the XF86Config file are easy to understand, if you're an XFree86 user whose initial XF86Config file does not work, pay specific attention to the Monitor section, the Device section, and the Screen section. The Monitor section contains specific details and settings for your monitor, such as your monitor's name, its horizontal and vertical sync ranges, and critical modelines (one for each video resolution, such as 640x480, 800x600, 1024x768, and so on). Understanding the modeline is the key to fine-tuning your X11 display.

For the best details, see the files VideoModes.doc and README.Config under the /usr/X11R6/lib/X11/doc directory before fine-tuning modeline s in your XF86Config file. Another good tutorial is the XFree86-Video-Timings-HOWTO under the /usr/doc/HOWTO directory.

The basic parts of a modeline are 10 different values representing the following (from left to right):

• A label of the screen resolution, such as 800x600

• A video frequency in MHz

• The number of visible dots per line on your display

• The Start Horizontal Retrace value (number of pulses before video sync pulse starts)

• The End Horizontal Retrace value (end of sync pulse)

• The total number of visible and invisible dots on your display

• The Vertical Display End value , or number of visible lines of dots on your display

• The Start Vertical Retrace value (number of lines before the sync pulse starts)

• The End Vertical Retrace value (number of lines at the end of the sync pulse)

• The Vertical Total value , or total number of visible and invisible lines on your dis­play

The XF86Config Device Section

The Device section contains details about your video chipset , such as RAM , clockchips , and so on. Note that even though you tell xf86config or XF86Setup that you have two megabytes of video RAM , these values are commented out with a pound sign (#). To properly configure for X, you need to remove the pound sign in front of the VideoRam setting in this part of the XF86Config file.This section of your XF86Config file is critical. The device definition is used to tell the X server exactly what type of video chipset and options to support. For a list of device identifiers and options , see the README file under the /usr/X11R6/lib/X11/doc directory corresponding with your chipset.

The XF86Config Screen Section

The Screen section tells what X server to use , the color depth (such as 8-, 16-, 24- or 32-bits per pixel), screen size (such as 640x480, 800x600, or 1024x768, and so on), and the size of the virtual screen .

This section contains directions for your chosen X server (the XF86_SVGA or other color server , the 4-bit, or 16-color XF86_VGA16 server , or the monochrome server , XF86_Mono ) on what resolutions and virtual screen size to support.

For example, if you're using the 8-bit, or 256-color, mode of the XF86 SVGA server, you might have the choice of a 640x480 display (with an 800x600 virtual screen) or an 800x600 display. Resolutions can be toggled during your X session by holding down the Ctrl+Alt keys and depressing the plus (+) or minus (-) keys on your keypad. Laptop users need to use the NumLock key before switching resolutions.