X is the standard graphical user interface (GUI) for Linux. Like other GUIs, such as Windows and Mac OS, the X Window System lets you interact with programs by using a mouse (or other pointing device) to point and click, providing a simple means of communicating with your computer.
Originally implemented as a collaborative effort of Digital Equipment Corporation (DEC) and the Massachusetts Institute of Technology (MIT), X was first released in 1987. Subsequently, the X Consortium, Inc. (http://www.x.org), became responsible for the continued development and publication of X.
Despite its age, X is a remarkable and very modern software system,
offering a cross-platform, network-oriented GUI. It runs on a wide
variety of platforms, including essentially every flavor of Unix,
such as Solaris, Linux, and the BSDs (FreeBSD, NetBSD, and OpenBSD).
X clients are available for use, for example, under Windows
x, NT, and 2000. The
sophisticated networking capabilities of X let you run a program on
one computer while viewing the graphical output on another computer
via a network connection.
Most Linux users run XFree86, a freely available software system compatible with X. XFree86 was developed by the XFree86 software team, which began work in 1992. In 1994, The XFree86 Project, Inc. (http://www.xfree86.org) assumed responsibility for ongoing research and development of XFree86.
Using the keyboard with X closely resembles using the keyboard with Windows. X sends your keyboard input to the active window, which is said to have the input focus. The active window is usually the window in which you most recently clicked the mouse.
This chapter refers to your pointing device as a mouse. However, like Windows, X supports a variety of pointing devices, such as optical mice and Wacom graphics tablets.
While Windows lets you choose to perform most operations by using the keyboard or mouse, X was designed for use with a mouse. If your mouse isn’t functioning, you’ll find it quite challenging or even impossible to use most X programs. X allows you to access only a few important functions via the keyboard:
Switching video modes
Using virtual consoles
Abruptly terminating X
When you configured X, you specified the video modes in which X can operate. Recall that the current video mode determines the resolution and color depth of the image displayed by your monitor—for example 16 bits per pixel color depth and 1024 x 768 pixels screen resolution.
By pressing Ctrl-Alt-+ (using the plus key on the numeric keypad), you command X to switch to the next video mode in sequence. X treats the video modes as a cycle: If X is operating in the last video mode, this key sequence causes X to return to the first video mode.
The similar key sequence Ctrl-Alt- - (using the minus key on the numeric keypad) causes X to switch to the previous video model. If you shift to a video mode that your monitor doesn’t support—as demonstrated by an unsteady or garbled image—you can use this key sequence to return to a supported video mode, avoiding the inconvenience of terminating X and reconfiguring your system.
Even while X is running, you can
access the Linux virtual consoles. To switch from graphical mode to a
virtual console running in text mode, type Ctrl-Alt-F
function key and
n is the number of the desired
virtual console. X uses virtual console 7, so only virtual consoles 1
through 6 are accessible while running X.
To switch from a virtual console back to X, type Ctrl-Alt-F7. Nothing is lost when you switch from X to a virtual console or back, so you can move freely between the graphical and text operating modes.
In Windows, you don’t need to restart in DOS mode simply to have access to the DOS command line. Similarly, in X you don’t need to switch to a virtual console simply to have access to the command line—X enables you to open a terminal window. A terminal window resembles the MS-DOS Prompt window or command-line interface window; like the Linux shell, it lets you type commands and view command output. Various window managers support different ways of accessing a terminal window.
The terminal window is just one example
of a frequently used program under X that you’ll want to
access. Most window managers install with a default set of common
programs that can be accessed by right-clicking with the mouse on the
desktop. For example, most window managers let you right-click on the
desktop and select a terminal window program from the pop-up menu
that appears. However, the pop-up menu displayed by a window manager
may display program names rather than program functions. In this
case, you may have some difficulty determining which entry on the
pop-up menu corresponds to a terminal program. Many programs that
provide terminal windows have names that include the sequences
xterm. Selecting such
an entry launches a terminal window. You’ll learn more about
window managers later in this chapter.
Copying and pasting text
To copy and paste text, you must first mark the text by moving the mouse to the beginning of the text; then click the left mouse button and drag the mouse across the text to be copied. X automatically copies the marked text into a buffer; you don’t need to press Ctrl-C or perform any other operation. If you find that you need to change the size of the marked text section, you can click the right mouse button and move the mouse to adjust the marked text.
Some window managers display a pop-up menu when you click the right button, even when the mouse cursor is above text. When using such a window manager, you cannot use the right mouse button to adjust the size of the marked text section.
To paste the text, properly position the insertion point and click the middle mouse button. If your mouse has only two buttons, simultaneously click the left and right buttons to simulate clicking the middle mouse button. You may find that this operation requires a little practice before you get it right, but once you’ve mastered it, you’ll find it works almost as well as having a three-button mouse.
Many X programs provide scrollbars that resemble those provided by Windows. However, the operation of scrollbars under X originally differed from that under Windows. Most X programs have been revised to display scrollbars that work like Windows scrollbars, although a few have not.
If you’re having trouble using a scrollbar, try using the original X method of working with it. To page forward, click the left mouse button on the scrollbar. Clicking near the top of the scrollbar scrolls forward a short distance, as little as a single line. Clicking near the bottom of the scrollbar scrolls the window by a page. To page backward, click the right mouse button on the scrollbar. Again, clicking near the top of the scrollbar scrolls a short distance, as little as a single line. Clicking near the bottom of the scrollbar scrolls the window by a page.
Under X, your desktop can be scrollable, that is, larger than the size of your monitor. For example, even if your monitor has a maximum resolution of 800 x 600, you might have a desktop of 1600 x 1200 or even 3200 x 2400. Such a desktop is known as a virtual desktop. Most desktop environments provide a tool called a pager, which lets you move around the virtual desktop. The pager provides a thumbnail view of your virtual desktop; by clicking within the thumbnail, you center your actual desktop on the clicked location. You’ll learn more about pagers in the next two chapters.
Using X means interacting with Linux on several different levels. X itself merely provides the graphics facility for displaying components of a GUI: X draws the screen, draws objects on the screen, and tracks user input actions such as keyboard input and mouse operations. To organize the desktop into familiar objects like windows, menus, and scrollbars, X relies on a separate program called a window manager. But even more functionality is required. A window manager alone doesn’t provide tight integration between applications of the sort required by drag-and-drop operations; that higher degree of integration comes from what’s called a desktop environment. While X itself is a single program, X under Linux supports several popular window managers and two popular desktop environments, GNOME and KDE.
Window managers create the borders, icons, and menus that provide a simple-to-use interface. Window managers also control the look and feel of X, letting you configure X to operate almost any way you desire. Table 4-4 describes the most popular Red Hat Linux window managers. For detailed information about a variety of window managers, see Matt Chapman’s xwinman.org web site.
Table 4-4. Popular Window Managers
A highly configurable, eye candy window manager. Has been in development status for a long time.
A window manager that sports an accompanying desktop, KDE. The combination of KWM and KDE provides a robust and efficient user interface. Not compliant with GNOME desktop.
Formerly known as Sawmill, Sawfish is the default window manager used with Red Hat Linux GNOME. A rather sparse but fast and reliable window manager.
A very basic and somewhat dated window manager. At one time, it was the dominant Linux window manager.
Resembles the user interface of the NeXT computer (NeXTStep). Compatible with KWM.
A desktop environment is a set of desktop tools and applications. The Windows desktop includes applications such as the Windows Explorer, accessories such as Notepad, games such as FreeCell and Minesweeper, and utilities such as the Control Panel and its applets. Although you can run X without a desktop, having a desktop helps you work more efficiently. The two most popular desktop environments used with Linux are GNOME and KDE.
GNOME, which stands for the GNU Network Object Model Environment (pronounced “guh-nome”), is a freely available desktop environment that can be used with any of several window managers, including Sawfish and Enlightenment. One of GNOME’s most interesting features is session awareness. When you reenter GNOME after logging out, it reconfigures your desktop to match the state at the time you exited by launching each application that was open when you exited. GNOME even restores each application to its former state by, for example, moving to the page that was open when you exited.
Utilities for configuring and using GNOME on your Linux system
GNOME is specially associated with the desktop suite known as GNOME Office, which includes the AbiWord word processor, the Gnumeric spreadsheet application, and 15 other applications. Chapter 5 explains how to configure and use GNOME.
KDE (the K Desktop Environment) is a freely available desktop that includes KWM, the K Window Manager, as an integral component. KDE provides a file manager, a help system, a configuration utility and a variety of accessories and applications, such as:
Network applications such as Kmail, a mail client; Knu, a network utility; and Krn, a news client
As with GNOME, new KDE accessories and applications are available almost weekly. Work is underway on a complete open source office suite (KOffice) that runs under KDE. You can learn more about KDE and the status of KOffice by browsing the KDE web site (http://www.koffice.org).
At one time, KDE was distributed under a license that suggested that some users owed a fee to developers of an important library used to develop KDE. This inhibited acceptance of KDE within the free software community. Several releases of Red Hat Linux featured only GNOME, despite the popularity of KDE among some users. Currently, KDE is open source and may be freely distributed. Although Red Hat defines GNOME as the default desktop environment, the standard Red Hat Linux distribution includes KDE, giving users a convenient desktop choice. KDE is explained in Chapter 6.