• Aucun résultat trouvé

Part III: Red Hat Desktop Workstation

Chapter 10: Window Managers

Overview

Unlike PC-based GUIs such as Windows or the Mac OS, Linux and Unix systems divide the GUI into three separate components: the X Window System, window managers, and

program/file managers. The X Window System, also known as X and X11, is an underlying standardized graphic utility that provides basic graphic operations such as opening windows or displaying images. A window manager handles windowing operations such as resizing and moving windows. Window managers vary in the way windows are displayed, using different borders and window menus. All, however, use the same underlying X graphic utility. A file manager handles file operations using icons and menus, and a program manager runs programs, often allowing you to select commonly used ones from a taskbar. Unlike window managers, file and program managers can vary greatly in their capabilities. In most cases, different file and program managers can run on the same window manager.

All Linux and Unix systems use the same standard underlying X graphics utility. This means, in most cases, that an X Window System-based program can run on any of the window managers and desktops. X Window System-based software is often found at Linux or Unix FTP sites in directories labeled X11. You can download these packages and run them on any window manager running on your Linux system. Some may already be in the form of Linux binaries that you can download, install, and run directly. Netscape is an example. Others will be in the form of source code that can easily be configured, compiled, and installed on your system with a few simple commands. Some applications, such as Motif applications, may require special libraries.

With a window manager, you can think of a window as taking the place of a command line.

Operations you perform through the window are interpreted and sent to the Linux system for execution. Window managers operate off the underlying X Window System, which actually provides the basic window operations that allow you to open, move, and close windows as well as display menus and select icons. FVWM2 and AfterStep manage these operations, each in its own way, providing their own unique interfaces. The advantage of such a design is that different window managers can operate on the same Linux system. In this sense, Linux is not tied to one type of graphical user interface (GUI). On the same Linux system, one user may be using the FVWM2 window manager, another may be using the Xview window manager, and still another the Enlightenment window manager, all at the same time. You can find out detailed information about different window managers available for Linux from the X11 Web

site at www.xwinman.org. The site provides reviews, screenshots, and links to home sites, as well as a comparison table listing the features available for the different window managers.

Window, File, and Program Managers

With a window manager, you can use your mouse to perform windowing operations such as opening, closing, resizing, and moving windows. Several window managers are available for Linux (see Table 10-1). Some of the more popular ones are Sawfish, Enlightenment, Window Maker, AfterStep, and the Free Virtual Window Manager 2.0 (FVWM2). FVWM2 is

traditionally used as the default backup window manager on most Linux systems. Window Maker and AfterStep are originally based on the NeXTSTEP interface used for the NeXT operating system. Enlightenment and Sawfish are the default window managers for Gnome by several distributions. Red Hat currently includes Enlightenment, Sawfish, and FVWM2. On Red Hat systems, Sawfish is used as the default window manager for Gnome and FVWM2 for a standard X Window System environment.

Window managers operate through the underlying X graphics utility. The X Window System actually provides the basic operations that allow you to open, move, and close windows as well as display menus and select icons. Window managers manage these operations each in their own way, providing different interfaces from which to choose. All window managers, no matter how different they may appear, use X Window System tools. In this sense, Linux is not tied to one type of graphical user interface. You can find out more about the X Window System at www.x.org.

Window managers originally provided only very basic window management operations such as opening, closing, and resizing of windows. Their features have been enhanced in the more sophisticated window managers such as Window Maker and Enlightenment to include support for virtual desktops, docking panels, and themes that let users change the look and feel of their desktop. However, to work with files and customize applications, you need to use file and program managers. With a file manager, you can copy, move, or erase files within different directory windows. With a program manager, you can execute commands and run programs using taskbars and program icons. A desktop program will combine the capabilities of window, file, and program managers, providing a desktop metaphor with icons and menus to run programs and access files. Gnome and the K Desktop are two such desktop programs.

Several window managers have been enhanced to include many of the features of a desktop.

The window managers included with many Linux distributions have program management capabilities in addition to window handling. FVWM2 and AfterStep have a taskbar and a workplace menu that you can use to access all your X programs. With either the menu or the taskbar, you can run any X program directly from FVWM2. Window Maker provides a NeXTSTEP interface that features a docking panel for your applications with drag-and-drop support. You can drag a file to the application icon to start it with that file.

Using just a window manager, you can run any X program. Window managers have their own workspace menu and taskbar. You can also run any X program from an Xterm terminal window. There you can type the name of an X application; when you press ENTER, the X application will start up with its own window. It is best to invoke an X application as a

background process by adding an ampersand (&) after the command. A separate window will open for the X application that you can work in.

Window Managers

Instead of the command line interface, you can use an X window manager and file manager, which will allow you to interact with your Linux system using windows, buttons, and menus.

Window managers provide basic window management operations such as opening, closing, and resizing windows, and file managers allow you to manage and run programs using icons and menus. The X Window System supports a variety of window managers. See Table 10-1 for a listing of window managers and desktops along with their Web sites where you can obtain more information. You can also download current versions from these Web sites.

Windows and Icons

You run applications, display information, or list files in windows. A window is made up of several basic components. The outer border contains resize controls. Also, various buttons enable you to control the size of a window or close the window. Inside the outer border are the main components of the window: the title bar, which displays the name of the window;

the menu, through which you can issue commands; and the window pane, which displays the contents of a window. You can change a window's size and shape using buttons and resize areas. The resize areas are the corner borders of the window. Click and hold a resize area and move the mouse to make the window larger or smaller in both height and width. You can make the window fill the whole screen using a maximize operation. Most window managers include a small button in the upper-right corner that you can click to maximize the window.

To reduce the window to its original size, just click the Maximize button again. If you want to reduce the window to an icon, click the Minimize button. It's the small square with a dot in the center next to the Maximize button. Once you have reduced the window to an icon, you can reopen it later by double-clicking that icon.

Applications that have been designed as X programs will have their own menus, buttons, and even icons within their windows. You execute commands in such X applications using menus and icons. If you are running an application such as an editor, the contents of the window will be data that the menus operate on. If you are using the file manager, the contents will be icons representing files and directories. Some windows, such as terminal windows, may not have menus.

You can have several windows open at the same time. However, only one of those windows will be active. On some window managers, just moving your mouse pointer to a particular window makes it the active window, rendering all others inactive. You will need to click the title bars of others. Most window managers let the user configure the method for making the window active.

Themes

Many window managers, such as Enlightenment, Sawfish, Window Maker, AfterStep, Blackbox, and FVWM2, support themes. Themes change the look and feel for widgets on your desktop, providing different background images, animation, and sound events. With themes, users with the same window manager may have desktops that appear radically different. The underlying functionality of the window manager does not change. You can easily download themes from Web sites and install them on your window manager. New ones are constantly being added. Information and links to window manager theme sites can be found at themes.org.

Workspace Menu

Most window managers provide a menu through which you can start applications, perform window configurations, and exit the window manager. Window managers give this menu different names. Enlightenment calls it the applications menu, Window Maker refers to it as the root-window menu, and FVWM2 calls it the workplace menu. In this chapter, it is referred to as the workspace menu. This menu is usually a pop-up menu that you can display by

clicking anywhere on the desktop. The mouse button you use differs with window managers.

Enlightenment and Sawfish use a middle-click, whereas Window Maker uses a right-click, and FVWM2 uses a left-click. Many of the entries on this workspace menu lead to submenus that in turn may have their own submenus. For example, applications will bring up a submenu listing categories for all your X programs. Selecting the graphics item will bring up a list of all the X graphic programs on your system. If you choose Xpaint, the Xpaint program will then start up. On some window managers you will find entries for window configuration and themes. Here will be items and submenus for configuring your window manager. For

example, both AfterStep and Enlightenment have menus for changing your theme (see Figures 10-3 and 10-4 for examples of workspace menus).

Desktop Areas and Virtual Desktops

Initially, you may find desktop areas disconcerting-they provide a kind of built-in

enlargement feature. You will discover that the area displayed on your screen may be only part of the desktop. Moving your mouse pointer to the edge of your screen moves the screen over the hidden portions of the desktop. You will also notice a small square located on your desktop or in your window manager's icon bar, taskbar, or panel. This is called the pager, and you use it to view different areas of your virtual desktop. The pager will display a rectangle for every active virtual desktop. Some window managers such as FVWM2 will display only two, others such as AfterStep will have four, and others such as FVWM will start out with only one.

Each desktop rectangle will be divided into smaller squares called desktop areas. You can think of each desktop area as a separate extension of your desktop. It's as if you have a very large desk, only part of which is shown on the screen. The active part of the desktop is shown in the pager as a highlighted square, usually in white. This is the area of the desktop currently displayed by your screen. A desktop can have as many as 25 squares, though the default is usually 4. You can click one of the squares in the rectangle to move to that part of your desk.

You could place different windows in different parts of your desk and then move to each part when you want to use its windows. In this way, everything you want on your desktop does not have to be displayed on your screen at once, cluttering it up. If you are working on the

desktop and everything suddenly disappears, it may be that you accidentally clicked one of the other squares. Certain items will always be displayed on your screen, no matter what part of the virtual desktop you display. These are called "sticky" items. The pager is one, along with taskbars or panels. For example, the taskbars, icon bars, and pager will always show up on your screen no matter what part of the virtual desktop you are viewing. Windows by default are not sticky, though you can make them sticky.

Most window managers also support virtual desktops. A desktop includes all the desktop areas, along with the items displayed on them such as icons, menus, and windows. Window managers such as Enlightenment, Sawfish, AfterStep, and FVWM2 allow you to use several virtual desktops. Unlike desktop areas, which just extend a desktop, virtual desktops are

separate entities. Most pagers will display the different virtual desktops as separate rectangles, each subdivided into its respective desktop areas. To move to a virtual desktop, you click its rectangle. In some window managers, such as Window Maker, you select the desktop from a list. Window managers will provide entries on their main menus for selecting virtual desktops and even moving windows from one desktop to another. Use a window manager's

configuration program or configuration files to specify the number of virtual desktops you want. For example, on Sawfish you can choose the number of virtual desktops and then add as many virtual areas as you want to each, extending the area as rows and columns. Only one virtual desktop can be active at any one time.