Part of the Linux GUI is a special type of X client known as a window manager. Earlier in this chapter in Exercise 14-1, you started the X.org server with the X command (which is linked to /usr/bin/Xorg). It turned your display into a blank electronic canvas. This is the default desktop display for the X.org server, which is an uninteresting textured gray background. The default mouse pointer for the X Window display is a graphic representation of an X.
Once the X.org server starts and this canvas is on your screen, the X server is ready to start serving X clients.
Still, you don't have any of the useful features that you've come to expect in a GUI, such as borders, title bars, menu bars, and minimize/maximize buttons. For this purpose, you need a window manager. A window manager is a special type of X client that can run only with an X server. The window manager controls how other X clients appear on your display. This includes everything from placing title bars and drawing borders around the window for each X client application you start, to determining the size of your desktop. In a nutshell, the window manager controls the look and feel of your GUI.
As is usually the case with all things Linux, you have multiple ways to do the same thing. RHEL can be installed with several different window managers and desktops. The GNOME and KDE desktops include their own window managers. Your choice of window manager and desktop will drive the look, feel, and functionality of the Linux X Window System.
Two powerful virtual desktop environments that come with RHEL are the GNOME Desktop Environment and KDE Desktop Environment. The GNOME desktop, shown in Figure 14-11, is the default desktop for RHEL that you first see after installing the X Window System. The KDE desktop, shown in Figure 14-12, is the main alternate desktop system. KDE is the default for several other Linux distributions.
Figure 14-11: The GNOME desktop
Figure 14-12: The KDE desktop
The GNOME desktop includes support for the GTK+ (GIMP) toolkit, which allows GNOME software components written in any language and running on different systems to work together. In addition, GNOME includes support from a number of other projects, including GConf, ORBIT, and more.
Many of the features of the GNOME interface will be familiar to you from other desktop environments. On the left side of the screen are icons representing files and applications that you can be open by double-clicking them with the mouse. The GNOME Desktop Environment also provides several virtual desktops. Next to the application buttons on the right side of the panel is a pager you can use to move from one area of the desktop to another.
One of the key features of GNOME are the panels, which you can see at the top and bottom of the screen in Figure 14-11. These panels are the control centers for most of your activities while you use GNOME. The button at the far left of the top panel with the imprint of a red hat is the Applications button. Click this button, and you will see a list of menus and submenus that start applications. The button associated with the System menu launches a similar submenu; The System | Administration submenu opens a number of interesting administrative applications.
GNOME includes a number of applications, including graphics tools and an office suite, GNOME Office. As the default Red Hat desktop is GNOME, the remainder of this book will be based on this desktop environment. Nevertheless, the Red Hat exam requirements do not specify a preferred desktop; you should have no problems using KDE or the command line console to do everything that is required for the exam. You may be asked to configure either desktop on the Red Hat exams.
If you configure the default GNOME desktop for your users, you may want to configure GNOME in a special way. Normally, GNOME opens with a number of icons and possibly default applications such as nautilus. You can add more default applications such as a new terminal window or applets such as the xminicom modem manager with the Sessions tool, which you can access via the System | Preferences | More Preferences | Sessions command.
The KDE desktop is built on the Qt C++ cross-platform GUI toolkit. This is another versatile way to create GUI applications for Linux.
Many of the features of KDE should also be familiar to you from other desktop environments. In fact, you can configure KDE to a look and feel that is quite similar to Windows 9x/2000/XP/Vista. As shown in Figure 14-12, it includes a Main Menu button, represented by the Red Hat in the lower-left corner of the desktop. Like GNOME, it can include pagers and buttons representing the open programs on the desktop. However, the default version of the KDE desktop is pretty empty, which does not illustrate the capabilities of KDE, and I'm guessing displeases most KDE loyalists.
Once you've configured the X Window, it's easy to start a Linux GUI. If it isn't already configured to start automatically, run the startx command. This command, in the /usr/bin directory, calls configuration files from your home directory. If these files don't exist, they are taken from the default directory for GUI configuration, /etc/X11.
To manage the default desktop, use the switchdesk command. It's also known as the Desktop Switching Tool; as they're not installed by default, you may need to first install at least the switchdesk RPM-and if you want to use the GUI version, the switchdesk-gui RPM packages. For example, the following commands set the default desktop to KDE and GNOME, respectively:
# switchdesk KDE # switchdesk GNOME
The switchdesk program creates two hidden files in your home directory, ~/.Xclients and ~/.Xclients-default, that are used to start your alternate desktop. You don't need to use switchdesk; once you have an ~/.Xclients-default file, you can edit it directly. It is a simple file with one key line:
If your default desktop is GNOME, this file has a different line:
Alternatively, you can use switchdesk to set up twm, known as Tom's Window Manager. The version of twm in RHEL includes a textured blue screen similar to the undefined gray screen that you saw earlier with the X command. The ~/.Xclients-default file would include the following line:
If you have other desktops or window managers installed, you can use those instead. When run from the command line, the switchdesk command can also let you set FVWM, Enlightenment, or WindowMaker as the default window manager. You'll see the new default the next time you run the startx command from a console command line interface.
Exercise 14-5: Exploring Desktops
In this exercise, use the switchdesk command to explore the various desktops available in RHEL.
The easiest way to make this work is if you've disabled any automatic login through the GUI. To do so, open a terminal window and run the init 3 command.
Now enter the GUI with the startx command.
Open a terminal window in a GUI and choose GNOME System | Preferences | More Preferences (or KDE Main Menu | Settings) | Desktop Switching Tool. You can also open it from a GUI command line with the switchdesk command.
Your current desktop (probably GNOME) is selected. Try one of the other desktops (such as KDE).
Log out of your current session with the GNOME System (or KDE Main Menu) | Log Out command.
Log back in again. This time you should see the other desktop environment.
Repeat step 3.
In the Desktop Switching Tool, try switching to twm.
Log out of KDE, and run the startx command again. You should see that twm is a much more basic window manager. You'll need to log out again for your changes to take effect.
To exit from twm, left-click the desktop. In the pop-up menu that appears, click Exit.
Run switchdesk from the command line. Select your favorite desktop. For example, if you want to make GNOME your default desktop again, run the switchdesk gnome command.