Полезная информация

Chapter 5. Configuring the X Window System

Table of Contents
Getting the X Window System Working with X-Configurator
Using the X Desktop Manager
Improving Font Appearance Under X
Choosing a Window Manager for X
GNOME Installation and Configuration
KDE Installation and Configuration

The X Window System, aka “X” (commonly and incorrectly known by many as “X-Windows”) is a GUI which sits on top of Linux. Unlike Microsoft Windows, the X Window System can look and operate in a large variety of different ways. It can operate very primitively or very advanced, look beautiful or ugly, be sleek and fast or bloated and slow (each of which are subjective qualities which cause as many arguments among users as the “Linux vs. Microsoft NT” debate seems to).

Getting X working properly can range from simple to hair-pulling complicated! It is a common complaint among users who are new to Linux, and I've fought with configuration settings countless times myself, so I'm completely empathic about this. Fortunately, such configuration is becoming easier and more automated in the newer distributions of Linux. In fact, if you are using Red Hat 6.1 you will probably not have to worry about this issue.

Although in a majority of cases X can be configured automatically, there are exceptions; I would recommend you know or find out the type of video card and amount of video RAM your system has installed, as well as the type of monitor and its horizontal and vertical synch rates (this information is usually available in the back pages of the monitor's users guide, or can be found on the WWW).

Getting the X Window System Working with X-Configurator

There are two main methods of getting X working under Red Hat's distribution of Linux. The first and easiest method, is to use Red Hat's own ``Xconfigurator'' utility. The utility tries to detect your hardware and installs the applicable X software with the appropriate configuration settings.

If you are still unsuccessful after trying out various settings with Xconfigurator, you may have better luck with the ``xf86config'' utility. Although certainly not as user-friendly or attractive as Xconfigurator is, it gives you finer control over the configuration process.

Finally, if you are still out of luck you may have to resort to editing the ``/etc/X11/XF86Config'' file by hand and tweaking various settings. If this is the case, you may need to get help from the Linux community (see the section called Where to Turn for Help in Chapter 13 for details). Relax, however -- in a majority of cases Xconfigurator does an adequate job!

After getting X working properly, you may be disappointed in the lack of rich colours. This is because X uses a default 8-bit per pixel (``bpp'') colour depth. You can use higher colour depths, however, assuming your video hardware will support them.

The various colour depths are listed in your ``/etc/X11/XF86Config'' file, and look like this:

    Subsection "Display"
        Depth       24
        Modes       "800x600" "1024x768"
        ViewPort    0 0
        Virtual     1024 768
    EndSubsection

The above section shows the possible resolutions which are available when using the 24-bit colour depth (800x600 and 1024x768, as listed in the “Modes” line); these resolutions can be switched between “on-the-fly” using the <Alt><+> and <Alt><-> keys.

Tip

Tip: As a default, when X starts up it does so using the lowest resolution. If you dislike this behaviour as much as I do, simply edit the ``/etc/X11/XF86Config'' file and reverse the resolutions (ie. “1024x768” “800x600”).

When you are getting things set up, you can test each colour depth manually by typing, ``startx -- -bpp 24'' (for the 24-bit depth) and make sure X is working properly for the colour depth you wish to use.)

If you are able to successfully use a higher colour depth and wish to use it as the default, you will need to create a ``/etc/X11/xinit/xserverrc'' file as follows:

exec X :0 -bpp 24

The above change will allow X to use 24 bits per pixel (if you have problems with this, try 16 or 32 instead of 24).

Assuming you have configured X properly, starting it is a simple matter of typing ``startx'' as any user. The X GUI will start, and after you have finished your session and quit X, you will be returned to the regular Linux console.

Optionally, X can start up at system boot, and always run (see the section called Using the X Desktop Manager for details on how to accomplish this). This can be handy for those users who dislike seeing the “boring” black & white console, or for those who wish to avoid dealing with command line shells as much as possible.