Chapter 12. The X Window System

Table of Contents

12.1. Optimizing the X Configuration
12.2. Installing and Configuring Fonts
12.3. OpenGL — 3D Configuration


The X Window System (X11) is the de facto standard for graphical user interfaces in UNIX. Moreover, X11 is network-based, enabling applications started on one host to be displayed on another host connected over any kind of network (LAN or Internet).

This chapter presents optimization possibilities for your X Window System environment, background information about the use of fonts in SUSE LINUX, and the configuration of OpenGL and 3D. The YaST modules for configuring the mouse and keyboard are covered in the chapter on installation in this manual (Section 2.4.5. “Graphics Card and Monitor (SaX2)”).

▪ s390;zseries
This chapter cannot be applied to SUSE LINUX Enterprise Server installations on S/390 and zSeries because the displays of these systems are not supported by XFree. ▪

12.1. Optimizing the X Configuration

To use the available hardware (mouse, graphics card, monitor, keyboard) in the best way possible, the configuration can be optimized manually. Some aspects of this optimization are explained below. For detailed information about configuring the X Window System, review the various files in the directory /usr/share/doc/packages/xf86 and man XF86Config.


Be very careful when configuring your X Window System. Never start the X Window System until the configuration is finished. A wrongly configured system can cause irreparable damage to your hardware (this applies especially to fixed-frequency monitors). The authors of this book and SUSE LINUX AG cannot be held responsible for damage. This information has been carefully researched, but this does not guarantee that all methods presented here are correct and will not damage your hardware.

The programs SaX2 and xf86config create the file XF86Config, by default in /etc/X11. This is the primary configuration file for the X Window System™. Find all the settings here concerning your graphics card, mouse, and monitor.

The following paragraphs describe the structure of the configuration file /etc/X11/XF86Config. Each section starts with the keyword Section <designation> and ends with EndSection. Below is a rough outline of the most important sections.

XF86Config consists of several sections, each one dealing with a certain aspect of the configuration. A section always has the same form:

Section designation
  entry 1
  entry 2
  entry n

The available section types are listed in Table 12.1. “Sections in /etc/X11/XF86Config”.

Table 12.1. Sections in /etc/X11/XF86Config

FilesThis section describes the paths used for fonts and the RGB color table.
ServerFlagsGeneral switches are set here.
InputDeviceInput devices, like keyboards and special input devices (touchpads, joysticks, etc.), are configured in this section. Important parameters in this section: Driver and the options defining the Protocol and Device.
MonitorDescribes the monitor used. The individual elements of this section are the name, which is referred to later in the Screen definition, the bandwidth, and the synchronization frequency limits (HorizSync and VertRefresh). Settings are given in MHz, kHz, and Hz. Normally, the server refuses any modeline that does not correspond with the specification of the monitor. This prevents too high frequencies from being sent to the monitor by accident.
ModesThe modeline parameters are stored here for the specific screen resolutions. These parameters can be calculated by SaX2 on the basis of the values given by the user and normally do not need to be changed. Intervene manually at this point, if, for example, you want to connect a fixed frequency monitor. Find details of the meaning of individual number values in the HOWTO file /usr/share/doc/howto/en/XFree86-Video-Timings-HOWTO.gz.
DeviceThis section defines a specific graphics card. It is referenced by its descriptive name.
ScreenThis section puts together a Monitor and a Device to form all the necessary settings for XFree. In the Display subsection, specify the size of the virtual screen (Virtual), the ViewPort, and the Modes used with this screen.
ServerLayoutThis section defines the layout of a single or multihead configuration. This section binds the input devices InputDevice and the display devices Screen.

Monitor, Device, and Screen are explained in more detail below. Further information about the other sections can be found in the manual pages of XFree86 and XF86Config.

There can be several different Monitor and Device sections in XF86Config. Even multiple Screen sections are possible. The following ServerLayout section determines which one is used.

12.1.1. Screen Section

First, take a closer look at the screen section, which combines a monitor with a device section and determines the resolution and color depth to use. A screen section might resemble Example 12.1. “Screen Section of the File /etc/X11/XF86Config”.

Example 12.1. Screen Section of the File /etc/X11/XF86Config

Section "Screen"
  DefaultDepth  16
  SubSection "Display"
    Depth       16
    Modes       "1152x864" "1024x768" "800x600"
    Virtual     1152x864
  SubSection "Display"
    Depth       24
    Modes       "1280x1024"
  SubSection "Display"
    Depth       32
    Modes "640x480"
  SubSection "Display"
    Depth        8
    Modes       "1280x1024"
  Device        "Device[0]"
  Identifier    "Screen[0]"
  Monitor       "Monitor[0]"

The line Identifier (here Screen[0]) gives this section a defined name with which it can be uniquely referenced in the following ServerLayout section. The lines Device and Monitor specify the graphics card and the monitor that belong to this definition. These are just links to the Device and Monitor sections with their corresponding names or identifiers. These sections are discussed in detail below.

Use the DefaultDepth setting to select the color depth the server should use unless it is started with a specific color depth. There is a Display subsection for each color depth. The keyword Depth assigns the color depth valid for this subsection. Possible values for Depth are 8, 15, 16, and 24. Not all X server modules support all these values.

After the color depth, a list of resolutions is set in the Modes section. This list is checked by the X server from left to right. For each resolution, a suitable Modeline is searched in the Modes section. The Modeline depends on the capability of both the monitor and the graphics card. The Monitor settings determine the resulting Modeline.

The first resolution found is the Default mode. With Ctrl-Alt-+ (on the number pad), switch to the next resolution in the list to the right. With Ctrl-Alt- (on the number pad), switch to the left. This enables you to vary the resolution while X is running.

The last line of the Display subsection with Depth 16 refers to the size of the virtual screen. The maximum possible size of a virtual screen depends on the amount of memory installed on the graphics card and the desired color depth, not on the maximum resolution of the monitor. Because modern graphics cards have a large amount of video memory, you can create very large virtual desktops. However, you may no longer be able to use 3D functionality if you fill most of the video memory with a virtual desktop. If the card has 16 MB video RAM, for example, the virtual screen can be up to 4096x4096 pixels in size at 8-bit color depth. Especially for accelerated cards, however, it is not recommended to use all your memory for the virtual screen, because this memory on the card is also used for several font and graphics caches.

12.1.2. Device Section

A device section describes a specific graphics card. You can have as many device entries in XF86Config as you like, as long as their names are differentiated, using the keyword Identifier. As a rule — if you have more than one graphics card installed — the sections are simply numbered in order. The first one is called Device[0], the second one Device[1], and so on. The following file shows an excerpt from the Device section of a computer with a Matrox Millennium PCI graphics card:

Section "Device"
  BoardName     "MGA2064W"
  BusID         "0:19:0"
  Driver        "mga"
  Identifier    "Device[0]"
  VendorName    "Matrox"
  Option        "sw_cursor"

If you use SaX2 for configuring, the device section should look something like the above example. Both the Driver and BusID are dependent on the hardware installed in your computer and are detected by SaX2 automatically. The BusID defines the PCI or AGP slot in which the graphics card is installed. This matches the ID displayed by the command lspci. The X server needs details in decimal form, but lspci displays these in hexadecimal form.

Via the Driver parameter, specify the driver to use for this graphics card. If the card is a Matrox Millennium, the driver module is called mga. The X server then searches through the ModulePath defined in the Files section in the drivers subdirectory. In a standard installation, this is the directory /usr/X11R6/lib/modules/drivers. For this purpose, simply _drv.o is added to the name, so, in the case of the mga driver, the driver file mga_drv.o is loaded.

The behavior of the X server or of the driver can also be influenced through additional options. An example of this is the option sw_cursor, which is set in the device section. This deactivates the hardware mouse cursor and depicts the mouse cursor using software. Depending on the driver module, there are various options available, which can be found in the description files of the driver modules in the directory /usr/X11R6/lib/X11/doc. Generally valid options can also be found in the manual pages (man XF86Config and man XFree86).

12.1.3. Monitor and Modes Section

Like the Device sections, the Monitor and Modes sections describe one monitor each. The configuration file /etc/X11/XF86Config can contain as many Monitor sections as desired. The server layout section specifies which Monitor section is relevant.

Monitor definitions should only be set by experienced users. The modelines constitute an important part of the Monitor sections. Modelines set horizontal and vertical timings for the respective resolution. The monitor properties, especially the allowed frequencies, are stored in the Monitor section.


Unless you have an in-depth knowledge of monitor and graphics card functions, nothing should be changed in the modelines, as this could cause severe damage to your monitor.

Those who try to develop their own monitor descriptions should be very familiar with the documentation in /usr/X11/lib/X11/doc. The section covering the video modes deserves a special mention. It describes in detail how the hardware functions and how to create modelines.

Manual specification of modelines is rarely required today. If you are using a modern multisync monitor, the allowed frequencies and optimal resolutions can, as a rule, be read directly from the monitor by the X server via DDC, as described in the SaX2 configuration section. If this is not possible for some reason, use one of the VESA modes included in the X server. This will function with practically all graphics card and monitor combinations.