Читать книгу Linux Bible - Christopher Negus - Страница 13
Part I
Getting Started
Chapter 2
Creating the Perfect Linux Desktop
Using the GNOME 2 Desktop
ОглавлениеThe GNOME 2 desktop is the default desktop interface used up through Red Hat Enterprise Linux 6. It is well-known, stable, and perhaps a bit boring.
GNOME 2 desktops provide the more standard menus, panels, icons, and workspaces. If you are using a Red Hat Enterprise Linux system up to RHEL 6 or an older Fedora or Ubuntu distribution, you are probably looking at a GNOME 2 desktop.
This section provides a tour of GNOME 2, along with some opportunities for sprucing it up a bit. Recent GNOME releases include advances in 3D effects (see “3D effects with AIGLX” later in this chapter) and improved usability features that I'll show you as well.
To use your GNOME desktop, you should become familiar with the following components:
● Metacity (window manager)– The default window manager for GNOME 2 is Metacity. Metacity configuration options let you control such things as themes, window borders, and controls used on your desktop.
● Compiz (window manager)– You can enable this window manager in GNOME to provide 3D desktop effects.
● Nautilus (file manager/graphical shell)– When you open a folder (by double-clicking the Home icon on your desktop, for example), the Nautilus window opens and displays the contents of the selected folder. Nautilus can also display other types of content, such as shared folders from Windows computers on the network (using SMB).
● GNOME panels (application/task launcher)– These panels, which line the top and bottom of your screen, are designed to make it convenient for you to launch the applications you use, manage running applications, and work with multiple virtual desktops. By default, the top panel contains menu buttons (Applications, Places, and System), desktop application launchers (Evolution email and Firefox web browser), a workspace switcher (for managing four virtual desktops), and a clock. Icons appear in the panel when you need software updates or SELinux detects a problem. The bottom panel has a Show Desktop button, window lists, a trash can, and a workspace switcher.
● Desktop area– The windows and icons you use are arranged on the desktop area, which supports drag-and-drop between applications, a desktop menu (right-click to see it), and icons for launching applications. A Computer icon consolidates CD drives, floppy drives, the filesystem, and shared network resources in one place.
GNOME also includes a set of Preferences windows that enable you to configure different aspects of your desktop. You can change backgrounds, colors, fonts, keyboard shortcuts, and other features related to the look and behavior of the desktop. Figure 2.15 shows how the GNOME 2 desktop environment appears the first time you log in, with a few windows added to the screen.
Figure 2.15 The GNOME 2 desktop environment.
The desktop shown in Figure 2.15 is for Red Hat Enterprise Linux. The following sections provide details on using the GNOME 2 desktop.
Using the Metacity window manager
The Metacity window manager seems to have been chosen as the default window manager for GNOME because of its simplicity. The creator of Metacity refers to it as a “boring window manager for the adult in you” and then goes on to compare other window managers to colorful, sugary cereal, whereas Metacity is characterized as Cheerios.
NOTE
To use 3D effects, your best solution is to use the Compiz window manager, described later in this chapter. You can't do much with Metacity (except get your work done efficiently). You assign new themes to Metacity and change colors and window decorations through the GNOME preferences (described later). Only a few Metacity themes exist, but expect the number to grow.
Basic Metacity functions that might interest you are keyboard shortcuts and the workspace switcher. Table 2.1 shows keyboard shortcuts to get around the Metacity window manager.
Table 2.1 Keyboard Shortcuts
You can use other keyboard shortcuts with the window manager as well. Select System Preferences Keyboard Shortcuts to see a list of shortcuts, such as the following:
● Run Dialog– To run a command to launch an application from the desktop by command name, press Alt+F2. From the dialog box that appears, type the command and press Enter. For example, type gedit to run a simple graphical text editor.
● Lock Screen– If you want to step away from your screen and lock it, press Ctrl+Alt+L. You need to type your user password to open the screen again.
● Show Main Menu– To open an application from the Applications, Places, or System menu, press Alt+F1. Then use the up and down arrow keys to select from the current menu, or use the right and left arrow keys to select from other menus.
● Print Screen– Press the Print Screen key to take a picture of the entire desktop. Press Alt+Print Screen to take a picture of the current window.
Another Metacity feature of interest is the workspace switcher. Four virtual workspaces appear in the Workspace Switcher on the GNOME 2 panel. You can do the following with the Workspace Switcher:
● Choose current workspace– Four virtual workspaces appear in the Workspace Switcher. Click any of the four virtual workspaces to make it your current workspace.
● Move windows to other workspaces– Click any window, each represented by a tiny rectangle in a workspace, to drag and drop it to another workspace. Likewise, you can drag an application from the Window list to move that application to another workspace.
● Add more workspaces– Right-click the Workspace Switcher, and select Preferences. You can add workspaces (up to 32).
● Name workspaces– Right-click the Workspace Switcher, and select Preferences. Click in the Workspaces pane to change names of workspaces to any names you choose.
You can view and change information about Metacity controls and settings using the gconf-editor
window (type gconf-editor
from a Terminal window). As the window says, it is not the recommended way to change preferences, so when possible, you should change the desktop through GNOME 2 preferences. However, gconf-editor
is a good way to see descriptions of each Metacity feature.
From the gconf-editor
window, select apps metacity, and choose from general, global_keybindings, keybindings_commands, window_keybindings, and workspace_names. Click each key to see its value, along with short and long descriptions of the key.
Changing GNOME's appearance
You can change the general look of your GNOME desktop by selecting System Preferences Appearance. From the Appearance Preferences window, select from three tabs:
● Theme– Entire themes are available for the GNOME 2 desktop that change the colors, icons, fonts, and other aspects of the desktop. Several different themes come with the GNOME desktop, which you can simply select from this tab to use. Or click Get more themes online to choose from a variety of available themes.
● Background– To change your desktop background, select from a list of backgrounds on this tab to have the one you choose immediately take effect. To add a different background, put the background you want on your system (perhaps download one by selecting
Get more backgrounds online
and downloading it to your Pictures folder). Then click Add, and select the image from your Pictures folder.● Fonts– Different fonts can be selected to use by default with your applications, documents, desktop, window title bar, and for fixed width.
Using the GNOME panels
The GNOME panels are placed on the top and bottom of the GNOME desktop. From those panels, you can start applications (from buttons or menus), see what programs are active, and monitor how your system is running. You can also change the top and bottom panels in many ways – by adding applications or monitors or by changing the placement or behavior of the panel, for example.
Right-click any open space on either panel to see the Panel menu. Figure 2.16 shows the Panel menu on the top.
Figure 2.16 The GNOME Panel menu.
From GNOME's Panel menu, you can choose from a variety of functions, including these:
● Use the menus
● The Applications menu displays most of the applications and system tools you will use from the desktop.
● The Places menu lets you select places to go, such as the Desktop folder, home folder, removable media, or network locations.
● The System menu lets you change preferences and system settings, as well as get other information about GNOME.
● Add to Panel– Add an applet, menu, launcher, drawer, or button.
● Properties– Change the panel's position, size, and background properties.
● Delete This Panel– Delete the current panel.
● New Panel– Add panels to your desktop in different styles and locations.
You can also work with items on a panel. For example, you can do the following:
● Move items– To move an item on a panel, right-click it, select Move, and drag and drop it to a new position.
● Resize items– You can resize some elements, such as the Window list, by clicking an edge and dragging it to the new size.
● Use the Window list– Tasks running on the desktop appear in the Window list area. Click a task to minimize or maximize it.
The following sections describe some things you can do with the GNOME panel.
Using the Applications and System menus
Click Applications on the panel, and you see categories of applications and system tools that you can select. Click the application you want to launch. To add an item from a menu so that it can launch from the panel, drag and drop the item you want to the panel.
You can add items to your GNOME 2 menus. To do that, right-click any of the menu names and select Edit Menus. The window that appears lets you add or delete menus associated with the Applications and System menus. You can also add items to launch from those menus by selecting New Item and typing the name, command, and comment for the item.
Adding an applet
You can run several small applications, called applets, directly on the GNOME panel. These applications can show information you may want to see on an ongoing basis or may just provide some amusement. To see what applets are available and to add applets that you want to your panel, follow these steps:
1. Right-click an open space in the panel so the Panel menu appears.
2. Click Add to Panel. An Add to Panel window appears.
3. Select from among several dozen applets, including a clock, dictionary lookup, stock ticker, and weather report. The applet you select appears on the panel, ready for you to use.
Figure 2.17 shows (from left to right) eyes, system monitor, weather report, terminal, and Wanda the fish.
Figure 2.17 Placing applets on the panel makes accessing them easy.
After an applet is installed, right-click it on the panel to see what options are available. For example, select Preferences for the stock ticker, and you can add or delete stocks whose prices you want to monitor. If you don't like the applet's location, right-click it, click Move, slide the mouse until the applet is where you want it (even to another panel), and click to set its location.
If you no longer want an applet to appear on the panel, right-click it, and click Remove From Panel. The icon representing the applet disappears. If you find that you have run out of room on your panel, you can add a new panel to another part of the screen, as described in the next section.
Adding another panel
If you run out of space on the top or bottom panels, you can add more panels to your desktop. You can have several panels on your GNOME 2 desktop. You can add panels that run along the entire bottom, top, or side of the screen. To add a panel, follow these steps:
1. Right-click an open space in the panel so the Panel menu appears.
2. Click New Panel. A new panel appears on the side of the screen.
3. Right-click an open space in the new panel, and select Properties.
4. From the Panel Properties, select where you want the panel from the Orientation box (Top, Bottom, Left, or Right).
After you've added a panel, you can add applets or application launchers to it as you did to the default panel. To remove a panel, right-click it and select Delete This Panel.
Adding an application launcher
Icons on your panel represent a web browser and several office productivity applications. You can add your own icons to launch applications from the panel as well. To add a new application launcher to the panel, follow these steps:
1. Right-click in an open space on the panel.
2. Click Add to Panel Application Launcher from the menu. All application categories from your Applications and System menus appear.
3. Select the arrow next to the category of application you want, and then select Add. An icon representing the application appears on the panel.
To launch the application you just added, simply click the icon on the panel.
If the application you want to launch is not on one of your menus, you can build a launcher yourself as follows:
1. Right-click in an open space on the panel.
2. Click Add to Panel Custom Application Launcher Add. The Create Launcher window appears.
3. Provide the following information for the application you want to add:
● Type– Select Application (to launch a regular GUI application) or Application in Terminal. Use Application in Terminal if the application is a character-based or ncurses application. (Applications written using the ncurses library run in a Terminal window but offer screen-oriented mouse and keyboard controls.)
● Name– Choose a name to identify the application (this appears in the tooltip when your mouse is over the icon).
● Command– This identifies the command line that is run when the application is launched. Use the full pathname, plus any required options.
● Comment– Enter a comment describing the application. It also appears when you later move your mouse over the launcher.
4. Click the Icon box (it might say No Icon), select one of the icons shown, and click OK. Alternatively, you can browse your filesystem to choose an icon.
5. Click OK.
The application should now appear in the panel. Click it to start the application.
NOTE
Icons available to represent your application are contained in the
/usr/share/pixmaps
directory. These icons are in either.png
or.xpm
formats. If there isn't an icon in the directory you want to use, create your own (in one of those two formats) and assign it to the application.
Adding a drawer
A drawer is an icon that you can click to display other icons representing menus, applets, and launchers; it behaves just like a panel. Essentially, any item you can add to a panel you can add to a drawer. By adding a drawer to your GNOME panel, you can include several applets and launchers that together take up the space of only one icon. Click the drawer to show the applets and launchers as if they were being pulled out of a drawer icon on the panel.
To add a drawer to your panel, right-click the panel and select Add to Panel Drawer. A drawer appears on the panel. Right-click it, and add applets or launchers to it as you would to a panel. Click the icon again to retract the drawer.
Figure 2.18 shows a portion of the panel with an open drawer that includes an icon for launching a weather report, sticky notes, and a stock monitor.
Figure 2.18 Add launchers or applets to a drawer on your GNOME 2 panel.
Changing panel properties
You can change the orientation, size, hiding policy, and background properties of your desktop panels. To open the Panel Properties window that applies to a specific panel, right-click an open space on the panel and choose Properties. The Panel Properties window that appears includes the following values:
● Orientation– Move the panel to a different location on the screen by clicking a new position.
● Size– Select the size of your panel by choosing its height in pixels (48 pixels by default).
● Expand– Select this check box to have the panel expand to fill the entire side, or clear the check box to make the panel only as wide as the applets it contains.
● AutoHide– Select whether a panel is automatically hidden (appearing only when the mouse pointer is in the area).
● Show Hide buttons– Choose whether the Hide/Unhide buttons (with pixmap arrows on them) appear on the edges of the panel.
● Arrows on hide buttons– If you select Show Hide Buttons, you can choose to have arrows on those buttons.
● Background– From the Background tab, you can assign a color to the background of the panel, assign a pixmap image, or just leave the default (which is based on the current system theme). Click the Background Image check box if you want to select an Image for the background, and then select an image, such as a tile from
/usr/share/backgrounds/tiles
or another directory.TIP
I usually turn on the AutoHide feature and turn off the Hide buttons. Using AutoHide gives you more desktop space to work with. When you move your mouse to the edge where the panel is, the panel pops up – so you don't need Hide buttons.
Adding 3D effects with AIGLX
Several initiatives have made strides in recent years to bring 3D desktop effects to Linux. Ubuntu, openSUSE, and Fedora used AIGLX (http://http://fedoraproject.org/wiki/RenderingProject/aiglx).
The goal of the Accelerated Indirect GLX project (AIGLX) is to add 3D effects to everyday desktop systems. It does this by implementing OpenGL (http://http://fedoraproject.org/wiki/RenderingProject/aiglxhttp://opengl.org) accelerated effects using the Mesa (http://www.mesa3d.org) open source OpenGL implementation.
Currently, AIGLX supports a limited set of video cards and implements only a few 3D effects, but it does offer some insight into the eye candy that is in the works.
If your video card was properly detected and configured, you may be able to simply turn on the Desktop Effects feature to see the effects that have been implemented so far. To turn on Desktop Effects, select System Preferences Desktop Effects. When the Desktop Effects window appears, select Compiz. (If the selection is not available, install the compiz package.)
Enabling Compiz does the following:
● Starts Compiz– Stops the current window manager and starts the Compiz window manager.
● Enables the Windows Wobble When Moved effect– With this effect on, when you grab the title bar of the window to move it, the window wobbles as it moves. Menus and other items that open on the desktop also wobble.
● Enables the Workspaces on a Cube effect– Drag a window from the desktop to the right or the left, and the desktop rotates like a cube, with each of your desktop workspaces appearing as a side of that cube. Drop the window on the workspace where you want it to go. You can also click the Workspace Switcher applet in the bottom panel to rotate the cube to display different workspaces.
Other nice desktop effects result from using the Alt+Tab keys to tab among different running windows. As you press Alt+Tab, a thumbnail of each window scrolls across the screen as the window it represents is highlighted.
Figure 2.19 shows an example of a Compiz desktop with AIGLX enabled. The figure illustrates a web browser window being moved from one workspace to another as those workspaces rotate on a cube.
Figure 2.19 Rotate workspaces on a cube with AIGLX desktop effects enabled.
The following are some interesting effects you can get with your 3D AIGLX desktop:
● Spin cube– Hold Ctrl+Alt keys, and press the right and left arrow keys. The desktop cube spins to each successive workspace (forward or back).
● Slowly rotate cube– Hold the Ctrl+Alt keys, press and hold the left mouse button, and move the mouse around on the screen. The cube moves slowly with the mouse among the workspaces.
● Scale and separate windows– If your desktop is cluttered, hold Ctrl+Alt and press the up arrow key. Windows shrink down and separate on the desktop. Still holding Ctrl+Alt, use your arrow keys to highlight the window you want and release the keys to have that window come to the surface.
● Tab through windows– Hold the Alt key, and press the Tab key. You see reduced versions of all your windows in a strip in the middle of your screen, with the current window highlighted in the middle. Still holding the Alt key, press Tab or Shift+Tab to move forward or backward through the windows. Release the keys when the one you want is highlighted.
● Scale and separate workspaces– Hold Ctrl+Alt, and press the down arrow key to see reduced images of the workspace shown on a strip. Still holding Ctrl+Alt, use the right and left arrow keys to move among the different workspaces. Release the keys when the workspace you want is highlighted.
● Send current window to next workspace– Hold Ctrl+Alt+Shift keys together, and press the left and right arrow keys. The next workspace to the left or right, respectively, appears on the current desktop.
● Slide windows around– Press and hold the left mouse button on the window title bar, and then press the left, right, up, or down arrow keys to slide the current window around on the screen.
If you get tired of wobbling windows and spinning cubes, you can easily turn off the AIGLX 3D effects and return to using Metacity as the window manager. Select System Preferences Desktop Effects again, and toggle off the Enable Desktop Effects button to turn off the feature.
If you have a supported video card, but find that you cannot turn on the Desktop Effects, check that your X server started properly. In particular, make sure that your /etc/X11/xorg.conf
file is properly configured. Make sure that dri
and glx
are loaded in the Module section. Also, add an extensions section anywhere in the file (typically at the end of the file) that appears as follows:
Another option is to add the following line to the /etc/X11/xorg.conf
file in the Device section:
The XAANoOffscreenPixmaps
option improves performance. Check your /var/log/Xorg.log
file to make sure that DRI and AIGLX features were started correctly. The messages in that file can help you debug other problems as well.