The most important file for Xorg is the xorg.conf configuration file, which can be located in the /etc/X11 directory. This file contains configuration information that is vital for X to function correctly, and is usually created during the installation of Fedora. Should you need to change anything post-install, you should use the system-config-display application, which is covered later in this chapter. Information relating to hardware, monitors, graphics cards, and input devices is stored in the xorg.conf file, so be careful if you decide to tinker with it in a text editor!

Of course, we would not send you in blindly to edit such an important file. Let's take a look at the contents of the file so that you can get an idea of what X is looking for. The components, or sections, of the xorg.conf file specify the X session or server layout, along with pathnames for files that are used by the server, any options relating directly to the server, any optional support modules needed, information relating to the mouse and keyboard attached to the system, the graphics card installed, the monitor in use, and of course the resolution and color depth that Fedora uses. Of the 12 sections of the file, these are the essential components:

ServerLayout — Defines the display, defines one or more screen layouts, and names input devices.

Files — Defines the location of colors, fonts, or port number of the font server.

Module — Tells the X server what graphics display support code modules to load.

InputDevice — Defines the input devices, such as the keyboard and mouse; multiple devices can be used.

Monitor — Defines the capabilities of any attached display; multiple monitors can be used.

Device — Defines one or more graphics cards and specifies what optional features (if any) to enable or disable.

Screen — Defines one or more resolutions, color depths, perhaps a default color depth, and other settings.

The following sections provide short descriptions of these elements; the xorg.conf man page contains full documentation of all the options and other keywords you can use to customize your desktop settings.

The ServerLayout Section

As noted previously, the ServerLayout section of the xorg.conf file defines the display and screen layouts, and it names the input devices. A typical ServerLayout section from an automatically configured xorg.conf file might look like this:

Section 'ServerLayout'

 Identifier 'single head configuration'

 Screen 0 'Screen0' 0 0

 InputDevice 'Mouse0' 'CorePointer'

 InputDevice 'Keyboard0' 'CoreKeyboard'

 InputDevice 'DevInputMice' 'AlwaysCore'

EndSection

In this example, a single display is used (the numbers designate the position of a screen), and two default input devices, Mouse0 and Keyboard0, are used for the session.

The Files Section

The Files section of the xorg.conf file might look like this:

Section 'Files'

 RgbPath '/usr/lib/X11/rgb'

 FontPath 'unix/:7100'

EndSection

This section lists available session colors (by name, in the text file rgb.txt) and the port number to the X font server. The font server, xfs, is started at boot time and does not require an active X session. If a font server is not used, the FontPath entry could instead list each font directory under the /usr/lib/X11/fonts directory, as in this example:

FontPath '/usr/lib/X11/fonts/100dpi'

FontPath '/usr/lib/X11/fonts/misc'

FontPath '/usr/lib/X11/fonts/75dpi'

FontPath '/usr/lib/X11/fonts/type1'

FontPath '/usr/lib/X11/fonts/Speedo'

...

These directories contain the default compressed fonts that are available for use during the X session. You configure the font server by using the file named config under the /etc/X11/fs directory. This file contains a listing, or catalog, of fonts for use by the font server. By adding an alternate- server entry in this file and restarting the font server, you can specify remote font servers for use during X sessions. This can help centralize font support and reduce local storage requirements (even though only 25MB is required for the almost 5,000 fonts installed with Fedora and X).

The Module Section

The Module section of the xorg.conf file specifies loadable modules or drivers to load for the X session. This section might look like this:

Section 'Module'

 Load 'dbe'

 Load 'extmod'

 Load 'fbdevhw'

 Load 'glx'

 Load 'record'

 Load 'freetype'

 Load 'type1'

 Load 'dri'

EndSection

These modules can range from special video card support to font rasterizers. The modules are located in subdirectories under the /usr/lib/modules directory.

The InputDevice Section

The InputDevice section configures a specific device, such as a keyboard or mouse, as in this example:

Section 'InputDevice'

 Identifier 'Keyboard0'

 Driver 'kbd'

 Option 'XkbModel' 'pc105'

 Option 'XkbLayout' 'us'

EndSection

Section 'InputDevice'

 Identifier 'Mouse0' Driver   'mouse'

 Option 'Protocol' 'IMPS/2'

 Option 'Device' '/dev/input/mice'

 Option 'ZAxisMapping' '4 5'

 Option 'Emulate3Buttons' 'yes'

EndSection

You can configure multiple devices, and there might be multiple InputDevice sections. The preceding example specifies a basic keyboard and a two-button PS/2 mouse (actually, a Dell touchpad pointer). An InputDevice section that specifies use of a USB device could be used at the same time (to enable mousing with PS/2 and USB pointers) and might look like this:

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату