Using the X Window System means interacting with Linux on several
different levels. X itself simply provides the graphics for displaying
components of a graphical user interface: X draws the screen, draws
objects on the screen, and tracks user input actions such as keyboard
input and mouse operations. To organize all of this into familiar
objects like windows, menus, and scrollbars, X relies on a separate
program called a window manager. A window manager alone won't
necessarily assure tight integration between applications running
under X; that higher degree of integration comes from something called
a desktop environment. While X itself is a single program, X under
Linux supports several popular window managers, and two popular
desktop environments.
To use X effectively, you'll learn
the basic keyboard and mouse operations for communicating with X. If
you're like most X users, you'll find it helpful to use a window
manager and a desktop with X. You'll learn why window managers and
desktops are useful and get help in choosing and setting up a window
manager and a desktop.
Using the keyboard with X closely resembles using the keyboard with
Microsoft 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; however, under some circumstances, it can be the window beneath
the mouse cursor.
This chapter refers to your pointing device as a
mouse. However, like Microsoft Windows, X supports a variety of pointing devices.
Microsoft Windows lets you choose to perform most operations by
using the keyboard or mouse. In contrast, X was designed for use with
amouse. If your mouse isn't functioning, you'll find it quite
challenging or even impossible to use most X programs.
Similarly, X provides a few important functions that you can
access only via the keyboard:
-
Using virtual consoles
-
Switching video modes
In addition, you can use the keyboard to terminate 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×768 pixels screen resolution.
By pressing
Shift-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
Shift-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 a unsteady or garbled image - you can use this key sequence to return to a supported video mode, avoiding the inconvenience of terminating X.
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
n, where
F
n is a function key and
n is the number of the desired virtual
console. X uses virtual console 7, so only virtual consoles 1-6
are accessible while running X.
To switch from a virtual console back to X, type
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.
As you learned in the previous chapter, you can terminate X by typing
Ctrl-Alt-Backspace. X immediately terminates each program running under X, closes each open window, and returns your system to text mode.
This key sequence terminates X abruptly; most window managers support gentler ways of terminating X. You'll learn about these later in this chapter.
While X is running, you cannot use the
Ctrl-Alt-Del sequence to reboot your system. To reboot your system, you can terminate X and then use the
Ctrl-Alt-Del sequence, or access a terminal window and enter the command:
shutdown -r now
The
shutdown command terminates X and then reboots your system.
In Windows, you need not restart in DOS mode simply to have access to the DOS command line. Similarly, in X you need not 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 familiar Microsoft Windows MS-DOS Prompt 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 left- or right-clicking with the mouse on the desktop. Most window managers, for example, let you 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
xt or
xterm. Selecting such an entry will probably launch a terminal window. You'll learn more about window managers and how to use them later in this chapter.