Using X11R7


X11R7 is the X server that is used with Ubuntu. The base Xorg distribution consists of 30 RPM packages (almost 120MB), which contain the server, along with support and development libraries, fonts, various clients, and documentation. An additional 1,000 or more X clients, fonts, and documentation are also included with Ubuntu.

Note

A full installation of X and related X11R7 files can consume moreusually much morethan 170MB of hard drive space. This is because additional clients, configuration files, and graphics (such as icons) are under the /usr/bin and /usr/share directory trees. You can pare excessive disk requirements by judiciously choosing which X-related packages (such as games) to install on workstations. However, with the increased capacity of most desktop PC hard drives today, the size requirements are rarely a problem, except in configuring thin-client desktops or embedded systems.


The /usr directory and its subdirectories contain the majority of Xorg's software. Some important subdirectories are

  • /usr/bin This is the location of the X server and various X clients. (Note that not all X clients require active X sessions.)

  • /usr/include This is the path to the files necessary for developing X clients and graphics such as icons.

  • /usr/lib This directory contains required software libraries to support the X server and clients.

  • /usr/lib/X11 This directory contains fonts, default client resources, system resources, documentation, and other files that are used during X sessions and for various X clients. You will also find a symbolic link to this directory, named X11, under the /usr/lib directory.

  • /usr/lib/xorg/modules This path links to drivers and the X server modules used by the X server enables use of various graphics cards.

  • /usr/X11/man This directory contains directories of man pages for X11 programming and clients

The main components required for an active local X session is installed on your system if you choose to use a graphical desktop. These components are the X server, miscellaneous fonts, a terminal client (that is, a program that provides access to a shell prompt), and a client known as a window manager. Window managers, which are discussed later in this chapter (see the section "Selecting and Using Window Managers"), administer onscreen displays, including overlapping and tiling windows, command buttons, title bars, and other onscreen decorations and features.

Elements of the xorg.conf File

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 Ubuntu. Should you need to change resolution or refresh frequency post-install, you should use the gnome-display-properties application, which we will cover 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 us 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 Ubuntu 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 (if any) features 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      "Default Layout"         Screen          "Default Screen"         InputDevice     "Generic Keyboard"         InputDevice     "Configured Mouse"         InputDevice     "stylus" "SendCoreEvents"         InputDevice     "cursor" "SendCoreEvents"         InputDevice     "eraser" "SendCoreEvents" 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. We also see that xorg.conf has been configured for use with a stylus (normally for use with a Tablet PC) but this can be ignored.

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/X11R6/lib/X11/fonts directory, as in this example:

Section "Files"         FontPath        "/usr/share/X11/fonts/misc"         FontPath        "/usr/share/X11/fonts/cyrillic"         FontPath        "/usr/share/X11/fonts/100dpi/:unscaled"         FontPath        "/usr/share/X11/fonts/75dpi/:unscaled"         FontPath        "/usr/share/X11/fonts/Type1"         FontPath        "/usr/share/X11/fonts/100dpi"         FontPath        "/usr/share/X11/fonts/75dpi"         # path to defoma fonts         FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" EndSection 


These directories contain the default compressed fonts that are available for use during the X session. If you have installed it, then the xfs is configured 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 Ubuntu 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    "bitmap"         Load    "ddc"         Load    "dri"         Load    "extmod"         Load    "freetype"         Load    "glx"         Load    "int10"         Load    "type1"         Load    "vbe" EndSection 


These modules can range from special video card support to font rasterizers. The modules are located in subdirectories under the /usr/lib/xorg/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           "Generic Keyboard"         Driver               "kbd"         Option               "CoreKeyboard"         Option               "XkbRules"      "xorg"         Option               "XkbModel"      "pc105"         Option               "XkbLayout"     "gb" EndSection Section "InputDevice"         Identifier           "Configured Mouse"         Driver               "mouse"         Option               "CorePointer"         Option               "Device"               "/dev/input/mice"         Option               "Protocol"             "ExplorerPS/2"         Option               "ZAxisMapping"         "4 5"         Option               "Emulate3Buttons"      "true" 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 Logitech Laser mouse).

The Monitor Section

The Monitor section configures the designated display device as declared in the ServerLayout section, as shown in this example:

Section "Monitor"         Identifier      "C17-5"         Option          "DPMS" EndSection 


Note that the X server automatically determines the best video timings according to the horizontal and vertical sync and refresh values in this section. If required, old-style modeline entries (used by distributions and servers prior to XFree86 4.0) might still be used. If the monitor is automatically detected when you configure X (see the "Configuring X" section, later in this chapter), its definition and capabilities are inserted in your xorg.conf file from the MonitorsDB database. This database contains more than 600 monitors and is located in the /usr/share/hwdata director.

The Device Section

The Device section provides details about the video graphics chipset used by the computer, as in this example:

Section "Device"         Identifier     "ATI Technologies, Inc. RV350 AR [Radeon 9600 XT]"         Driver         "fglrx"         BusID          "PCI:1:0:0"         Option         "UseFBDev"              "true" EndSection 


This example identifies an installed video card as using an ATI Radeon 9600 XT (RV350) graphics chipset. The Driver entry tells the Xorg server to load the fglrx_drv.o module from the /usr/lib/xorg/modules/drivers directory. Different chipsets have different options. For example, here's the entry for a NeoMagic video chipset:

Section "Device"         Identifier   "NeoMagic (laptop/notebook)"         Driver       "neomagic"         VendorName   "NeoMagic (laptop/notebook)"         BoardName     "NeoMagic (laptop/notebook)"     Option     "externDisp"     Option     "internDisp" EndSection 


In this example, the Device section specifies the driver for the graphics card (neomagic_ drv.o) and enables two chipset options (externDisp and internDisp) to allow display on the laptop's LCD screen and an attached monitor.

The Xorg server supports hundreds of different video chipsets. If you configure X11 but subsequently change the installed video card, you need to edit the existing Device section or generate a new xorg.conf file, using one of the X configuration tools discussed in this chapter, to reflect the new card's capabilities. You can find details about options for some chipsets in a companion man page or in a README file under the /usr/lib/X11/doc directory. You should look at these sources for hints about optimizations and troubleshooting. However, this should be fairly rare as Ubuntu sports a comprehensive hardware detection system, automatically adjusting settings to take account of newly installed hardware.

The Screen Section

The Screen section ties together the information from the previous sections (using the Screen0, Device, and Monitor Identifier enTRies). It can also specify one or more color depths and resolutions for the session. Here's an example:

Section "Screen"         Identifier      "Default Screen"         Device          "ATI Technologies, Inc. RV350 AR [Radeon 9600 XT]"         Monitor         "C17-5"         DefaultDepth    24         SubSection "Display"                 Depth            24                 Modes            "1280x1024" "1024x768" "800x600" "640x480"         EndSubSection         SubSection "Display"                 Depth            16                 Modes            "1280x1024" "1024x768" "800x600" "640x480"         EndSubSection         SubSection "Display"                 Depth            8                 Modes            "1280x1024" "1024x768" "800x600" "640x480"         EndSubSection ... 


In this example a color depth of millions of colors and a resolution of 1280x1024 is the default, with optional resolutions of 1024x768, 800x600, and 640x480. Multiple Display subsection entries with different color depths and resolutions (with settings such as Depth 16 for thousands of colors) can be used if supported by the graphics card and monitor combination. You can also use a DefaultDepth enTRy (which is 24, or millions of colors, in the example), along with a specific color depth to standardize display depths in installations.

You can also specify a desktop resolution larger than that supported by the hardware in your monitor or notebook display. This setting is known as a virtual resolution in the Display subsection. This allows, for example, an 800x600 display to pan (that is, slide around inside) a virtual window of 1024x768.

Note

If your monitor and graphics card support multiple resolutions and the settings are properly configured, you can use the key combination of Ctrl+Alt+Keypad+ or Ctrl+Alt+Keypad- to change resolutions on the fly during your X session.


Configuring X

Although the Ubuntu installer can be relied upon to configure X during installation, problems can arise if the PC's video card is not recognized. If you do not get the graphical login that should come up when you reboot after installation (refer to Chapter 3, "Installing Ubuntu"), then you will have to do some configuration by hand in order to get X working. Note that some installs, such as for servers, do not require that X be configured for use to support active X sessions, but might require installation of X and related software to support remote users and clients.

You can use the following configuration tools, among others, to create a working xorg.conf file:

  • dpkg reconfigure xserver-xorg This is Ubuntu's text-based configuration tool, which guides you through creating an xorg.conf file.

  • Xorg The X server itself can create a skeletal working configuration.

The following sections discuss how to use each of these software tools to create a working xorg.conf file.

Configuring X with the dpkgreconfigure Option

You can use the dpkgreconfigure client to create or update an xorg.conf file. The beauty of this tool is that it is command line only, so it can be used if you have problems with your Xorg server. You start it by getting to a terminal and entering:

$ sudo dpkgreconfigure xserver-xorg


to bring up the configuration dialog for configuring X. Your best bet is to try the autodetect before heading on to manually configure the X server. Nine times out of ten Ubuntu gets it right, but if you need to manually configure X then make sure you have all the necessary details such as:

  • Graphics card make and chipset (e.g. ATI 9600 ([r350])

  • Amount of memory on your graphics card

  • Refresh rates (both horizontal and vertical) for your monitor

  • Supported screen resolutions for your monitor

  • Type of keyboard and mouse that you are using

If you have all of this information available then you will have no problem configuring X.

Using Xorg to Configure X

You can create the xorg.conf file manually by typing one from scratch using a text editor, but you can also create one automatically by using the Xorg server or configuration utilities (as discussed in the previous sections). As the root operator, you can use the following on the server to create a test configuration file:

# X -configure


After you press Enter, a file named xorg.conf .new is created in root's home directory, the /root directory. You can then use this file for a test session, like this:

# X config /root/xorg.conf.new




Ubuntu Unleashed
Ubuntu Unleashed 2011 Edition: Covering 10.10 and 11.04 (6th Edition)
ISBN: 0672333449
EAN: 2147483647
Year: 2006
Pages: 318

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net