Tải bản đầy đủ (.pdf) (41 trang)

Running Linux phần 7 potx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (618.34 KB, 41 trang )

Chapter 11. Customizing Your X Environment
343
color names (and corresponding RGB values) is given in the file /usr/lib/X11/rgb.txt. Running
xcolors will display these colors, along with their names.
Line 6 runs another xterm, although the arguments are slightly different:
xterm -geometry -20+10 -fn 7x13bold -fg darkslategray -bg white &
First of all, the geometry specification is just
-20+10
. Without size parameters, xterm will
use the default, which is usually
80x25. Also, we see that the xoffset is prefixed with a -,
instead of a
+
. This places the window 20 pixels from the right edge of the screen. Likewise, a
geometry specification of
-20-30 (as used on line 7) means to place the window 20 pixels
from the right edge of the screen and 30 pixels from the bottom. In this way, the placement of
windows is less dependent on the particular resolution you're using.
The -fn option on lines 6 and 7 specifies that the font used by xterm should be
7x13bold
.
Using the command xlsfonts displays a complete list of fonts on your system; the X client
xfontsel allows you to select fonts interactively — more about fonts later.
On line 10 we start an oclock client, which is a simple analog clock. Line 11 starts xload,
which displays a graph of the system load average (number of running processes) that
changes with time. Line 12 starts xbiff, which just lets you know when mail is waiting to be
read. Finally, on line 13 we do away with the bland gray X background and replace it with a
flashy darkslateblue. (Fear not; there is more fun to be had with X decor than this example
shows.)
You'll notice that each X client started on lines 6-13 is executed in the background (the
ampersand on the end of each line forces this). If you forget to put each client in the


background, xinit executes the first xterm, waits for it to exit (usually after you log out),
executes the next xterm, and so on. The ampersands cause each client to start up concurrently.
What about line 16? Here, we start fvwm (Version 2), a window manager used on many Linux
systems. As mentioned before, the window manager is responsible for decorating the
windows, allowing you to place them with the mouse, and so forth. However, it is started with
the command:
exec fvwm2
This causes the fvwm2 process to replace the xinit process. This way, once you kill fvwm,
2

the X server shuts down. This is equivalent to, but more succinct than, using the Ctrl-Alt-
Backspace key combination. Whether you are returned to the command line after the X server
has shut down or are presented with a new graphical login depends on your system
configuration.
In general, you should put an ampersand after each X client started from .xinitrc, and exec the
window manager at the end of the file. Of course, there are other ways of doing this, but many
users employ this technique.


2
If you have experimented with fvwm, you'll notice that pressing the first mouse button while the cursor is on
the background causes a menu to pop up. Selecting the Quit fvwm option from this menu causes fvwm to exit.
Chapter 11. Customizing Your X Environment
344
The fvwm2 window manager was the default window manager on most Linux systems for a
very long time. It is still around, but has mostly been superseded by either the very advanced
kwin window manager shipped with KDE or one of the more modern freestanding window
managers, such as blackbox or sawfish.
If you read the manual pages for xterm and the other X clients, you'll see many more
command-line options than those described here. As we said, virtually everything about X is

configurable. fvwm (Version 2) uses a configuration file of its own, .fvwm2rc, described in its
manual page. (If you have no .fvwm2rc file, the system default
/usr/lib/X11/fvwm2/system.fvwmrc is used instead.) More modern window managers still use
configuration files, but usually provide you with user-friendly, GUI-based configuration
programs that let you make your settings and then save them to the configuration file in the
correct format. The manual pages, as well as books on using X, such as the X Window System
User's Guide (O'Reilly), provide more information on configuring individual clients.
11.2 The K Desktop Environment
The K Desktop Environment (KDE) is an open source software project that aims at providing
a consistent, user-friendly, contemporary desktop for Unix, and hence, Linux systems. Since
its inception in October 1996, it has made great progress. This is partly due to the choice of a
very high-quality GUI toolkit, Qt, as well as the consequent choice of using C++ and its
object-oriented features for the implementation.
It should be noted up front that KDE is not a window manager like fvwm, but a whole desktop
system that can be used with any window manager. However, it also comes with its own
window manager called kwin, which will give the best results and is therefore what we will
cover here.
The current development version of KDE, as well as the upcoming KDE office suite (see
), is based heavily on KParts, a component technology which, among
other things, enables the embedding of office components, such as embedding the PDF viewer
into the web browser for seemless viewing of downloaded PDF files, and so on.
KDE is in continuing development, but every few months the KDE team puts out a so-called
official release that is considered very stable and suitable for end users. These releases are
made available in both source and binary packages in various formats, often specifically
adapted for the most common Linux distributions. If you don't mind fiddling around with
KDE and can stand an occasional bug, you can also live on the bleeding edge and download
daily snapshots of KDE, but this is not for the faint-hearted. At the time of this writing, the
current stable release is 3.0.2, with 3.0.3 just looming around the corner.
11.2.1 General Features
We have already hinted a couple of times that configuring window managers and X

applications for a long time meant learning the varying syntax of configuration files and
editing those files, something that long-term Linux users take for granted but that often
rebuffs new users. One of the goals of the KDE team is therefore to make everything in KDE
configurable by GUI dialogs. You can still edit configuration files, if you prefer, but you don't
need to, and even the most experienced users usually admit that in order to do simple things,
such as change the background color of the desktop, it's faster to click a few buttons than to
Chapter 11. Customizing Your X Environment
345
read the manual page, find the syntax for specifying the background color, open the
configuration file, edit it, and restart the window manager.
Besides easy configuration, KDE sports a few other features that were previously unheard of
on Linux. For example, it integrates Internet access fully into the desktop. It comes with a file
manager that doubles as a web browser (or the other way around), and browsing files on some
FTP sites is just the same as browsing your local hard disk. You can drag and drop icons that
represent Internet locations to your desktop and thus easily find them again later. KDE
integrates search engines and other Internet resources into your desktop and even lets you
define your own favorite search engines and Internet links with ease. In addition, almost all
KDE application are able to open and save files in remote locations.
Drag-and-drop, commonplace on Windows or the Macintosh, is also widely used in KDE. For
example, to open a file in the text editor, you just grab its icon in the file manager window and
drop it onto the editor window. This works no matter where the file is located; if it is on a
remote server, KDE automatically downloads the file for you before opening it in the text
editor or whichever application you choose to open it with. The same goes for multimedia
files. Just by clicking an icon for an MP3 file on a remote server, you can download it in the
background and play it locally.
While manual pages are designed well to give programmers instant access to terse
information about system libraries, they are not really very well suited for end-user
documentation. KDE therefore uses standard HTML files and comes with a fast help viewer,
the KDE Help Center. The viewer also knows how to display manual page and Info files so
that you can access all the documentation on your system from one application. In addition,

most KDE applications support context-sensitive help.
For the past few releases, the X Window System has supported a feature called session
management. When you leave your X environment, log off, or reboot, an application that
understands session management will reappear at the same positions and in the same
configuration. Unfortunately, this very user-friendly feature was rarely supported by X
applications. KDE uses it extensively. KDE provides a session manager that handles session
management, and all KDE applications are written to behave properly with that feature.
KDE contains a window manager, kwin, and an excellent one at that, but that is only one part
of KDE. Some of the others are the file manager, the web browser, the panel, a pager, the
control center for configuring your desktop, and many, many more. If you want to, you can
even run KDE with another window manager, but you might lose some of the integration
features. Also, KDE comes with tons of applications, from a full office productivity suite to
PostScript and PDF viewers to multimedia software to games.
You might be thinking, "Well, this all sounds very nice, but I have a couple of normal X
applications that I want to run." In this case, you will be delighted to hear that you can
continue to do that. Yes, you can run all X applications on a KDE desktop, and KDE even
provides some means of integrating them as far as possible into the overall desktop. For
example, if you desire, KDE can try to reconfigure your other X applications to use the same
colors as the overall desktop so that you get a nice consistent environment. Of course, non-
KDE applications will not support some of KDE's advanced features like drag-and-drop or
session management, but you can continue to use the programs you have grown accustomed
Chapter 11. Customizing Your X Environment
346
to until someone releases KDE applications that address the same needs (or perhaps KDE
versions of your favorite programs themselves).
11.2.2 Installing KDE
Most Linux distributions come with KDE nowadays, but if yours doesn't, or you want to use a
newer version of KDE, you can download it from the Internet. is your
one-stop shop for everything KDE-related, including documentation, screenshots, and
download locations. is the KDE project's FTP site, but it is often overloaded,

so you might be better off trying a mirror instead.
KDE consists of a number of packages. These include:
kdesupport
This package contains third-party libraries that are not part of KDE itself but that are
used by KDE. It is recommended that you install this package to make sure that you
have the correct versions of all the libraries installed.
aRts
aRts is short for "real-time sequencer" and forms the base of most of the multimedia
capabilities of KDE.
kdelibs
The KDE libraries. They contain the basic application frame, a number of GUI
widgets, the configuration system, the HTML display system, and many other things.
Without this package, nothing in KDE will run.
kdebase
In this package, you will find the basic KDE applications that make a desktop a KDE
desktop, including the file manager/web browser, the window manager, and the panel.
You definitely need this package if you want to use KDE.
kdegames
A number of games, including card games, action games, and strategy games.
Everybody will probably want to install these, but only to get acquainted with the
system, of course.
kdegraphics
A number of graphics-related programs such as a dvi viewer, a PostScript viewer, and
an icon editor.



Chapter 11. Customizing Your X Environment
347
kdeutils

Some productivity tools, such as text editors, a calculator, printer managers, and an
address-book program.
kdemultimedia
As the name implies, this package contains multimedia programs, including a CD
player, a MIDI player and — of all things — a Karaoke player.
kdenetwork
Here, you will find programs for use with the Internet, including a mail reader, a news
reader, and some network management tools.
kdeadmin
This package contains some programs for the system administrator, including a user
manager, a runlevel editor, and a backup program.
kdepim
The notable tool in this package is korganizer, a full-featured personal information
manager that even supports synchronization with Palm Pilots.
kdeedu
As the name implies, this package contains a set of educational programs, ranging
from vocabulary trainers to programs teaching you the movements of the planets and
stars.
koffice
KOffice is no less than a complete feature-rich office productivity suite. It may have a
few rough edges here and there, but many people use it already for their daily work.
The release cycle of KOffice is today decoupled from KDE's release cycle. At the time
of this writing, the current version is 1.1.2. You can read all about KOffice at
.
In addition to the packages mentioned here, which are officially provided by the KDE team,
literally hundreds of other KDE programs are available. See
for a list of applications that are currently available.
Once you have selected which packages to install, you can go on and actually install them.
How you do that depends on which Linux distribution you use and whether you install a
binary package or compile KDE yourself from the source code. If your distribution contains

KDE, you will also be able to install KDE during your system installation.
Chapter 11. Customizing Your X Environment
348
Once the software is loaded onto your hard disk, there are only a few steps left to take. First,
you have to make sure that the directory containing the KDE applications is in your
PATH
environment variable. The default location of the executable KDE programs is /opt/kde3/bin,
but if you have chosen to install KDE to another location, you will have to insert your path
here.
3
You can add this directory to your
PATH
variable by issuing:
export PATH=/opt/kde3/bin:$PATH
To make this permanent, add this line to either the .bashrc configuration file in your home
directory, or the system-wide configuration file, /etc/profile.
Next, do the same with the directory containing the KDE libraries (by default /opt/kde3/lib)
and the environment variable
LD_LIBRARY_PATH
:
export LD_LIBRARY_PATH=/opt/kde3/lib:$LD_LIBRARY_PATH
Now you are almost done, but you still need to tell X that you want to run the KDE desktop
when X starts. This is done in the file .xinitrc in your home directory. Make a backup copy
first. Then remove everything in this file and insert the single line:
exec startkde
startkde is a shell script provided with KDE that simply starts up the KDE window manager
kwin and a number of system services. Distributions will usually install a somewhat more
complex .xinitrc file that may even start non-KDE applications and services.
11.2.3 Using KDE
Using KDE is quite easy. Most things are very intuitive, so you can often simply guess what

to do. We will, however, give you some hints for what you can do with KDE here, to
encourage you to explore your KDE desktop further.
11.2.3.1 The KDE panel and the K menu
When you start KDE for the first time, it looks like Figure 11-2. Along the lower border of
the screen, you see the so-called panel. The panel serves several purposes, including fast
access to installed applications. Along the upper border, you can see the taskbar. This bar
shows all open windows and can be used to quickly access any window currently on
the desktop. In addition, KDE opens a configuration program that lets you configure the
initial settings when started for the first time.





3
Some distributions might put the KDE programs elsewhere, such as in /usr/bin.
Chapter 11. Customizing Your X Environment
349
Figure 11-2. The KDE desktop at startup

KDE provides a number of workspaces that are accessible via the buttons in the middle of the
panel, labeled One to Eight by default. Try clicking those buttons. You can see that windows
that you have opened are visible only while you are on workspace One, while the panel and
the taskbar are always visible. Now go to workspace Two and start a terminal window by
clicking the terminal icon on the panel. When the panel appears, change workspaces again.
You will see that the terminal window is visible only while you are on workspace Two, but its
label is visible on the taskbar that appears in all workspaces. When you are on any other
workspace, click the terminal label in the taskbar. This will immediately bring you back to the
workspace where your terminal is shown.
To try another nifty feature, push the small button that looks like a pushpin in the titlebar of

the terminal window. Now change workspaces again. You will see that the terminal window
is now visible on every workspace — it has been "pinned down" to the background of the
desktop, so to speak.
If you grow tired of seeing the terminal window on every workspace, simply click the pin
again, and if you want to get rid of the window as a whole, click the button with the little x on
it in the upper-right corner.
There are lots of things that you can do with windows in KDE, but we'll switch now to a short
exploration of the so-called K menu. You open the K menu by clicking the icon with the gear-
and-K symbol to the far left of the panel. Besides some options for configuring the K menu
and the panel itself, you will find all installed KDE applications here, grouped into submenus.
To start one of those applications, select the menu entry.
We have promised that you can run old X applications on your KDE desktop. You can do that
either by opening a terminal window and typing the application name on the command line,
or by pressing Ctrl-F2 and entering the application name in the small command line that
Chapter 11. Customizing Your X Environment
350
appears in the middle of the screen. But, with a little more work, you can also integrate non-
KDE applications into the K menu and the panel, which then displays icons that you can click
to run the associated programs
Depending on how you have installed KDE, it may well be that there is already a submenu of
non-KDE programs in your K menu that contains a number of non-KDE applications. If you
don't have this, run the application KAppfinder, which you can find in the System submenu.
This searches your system for a number of applications that it has in its database and
integrates each one into the KDE desktop by generating a so-called .desktop file for it. If the
program that you want to integrate into KDE is not included in the Appfinder's database, you
will have to write such a .desktop file yourself. But as always in KDE, there are dialogs for
doing this where you just have to fill in the required information. See the KDE documentation
at
By default, the panel already contains a number of icons to start the most often-used
programs, but you can easily add your own. To do this, open the K menu again, and click the

submenus Configure Panel
Add Button. A copy of the whole K menu pops up. Find
the application whose icon you want to add to the panel and select it, just as if you wanted to
start it. KDE will then add the icon for this application to the panel. You can even add full
submenus to the panel by selecting the first menu entry in a submenu in the Add/Button tree.
The icon will then have a small black arrow in it, which indicates that clicking the icon opens
a menu instead of starting an application.
There is only limited space on the panel, so you might need to remove some icons of
programs that you do not often use. Just click with the right mouse button on the icon and
select Remove. This does not remove the program, just its icon. In general, you can get at a
lot of functionality in KDE by clicking the right mouse button!
11.2.3.2 The KDE Control Center
Next, we will show you how to configure your KDE desktop to your tastes. As promised, we
will not edit any configuration files to do this.
Configuration is done in the KDE Control Center, which you can start from the K menu. All
the configuration options are grouped at different levels. When you start up the control center,
you will see the top-level groups. By clicking the plus signs, you can open a group to see the
entries in this group.
11.2.3.2.1 Configuring the background
As an example, we will now change the background color to something else. To do this, open
the Look & Feel group and choose Background. The configuration window for configuring
the background will appear (see Figure 11-3).




Chapter 11. Customizing Your X Environment
351
Figure 11-3. Configuring the background of the KDE desktop


You can select a single-colored background, a two-colored background with a number of
gradients where one color is slowly morphed into another, a wallpaper (predefined or an
image of your own choice), or a bleeding effect that combines various choices. To select
colors, click either the Color 1 or the Color 2 color button; a color selection dialog pops up
where you can select a color to your taste. When you close the color selection dialog, the new
color is displayed in the monitor in the upper-right corner of the configuration window. When
you configure KDE, you often see such monitors that allow you to preview your choice.
However, you also have the option to see what your choice looks like when in full use.
Simply click the Apply button at the lower border of the configuration window, and your
change is automatically applied. There is no need to restart the desktop.
If you'd rather have a monocolored background, select Flat from the Mode combo box. You
will see that the color button for the Color 2 is grayed out then. Select the color you want with
the Color 1 button.
On the Wallpaper tab, you can select a background image as your wallpaper. KDE ships with
a large number of wallpapers, but you can also select your own pictures (such as a digitized
photo of your family). You can even configure multiple wallpapers that appear in succession
at intervals you define. Finally, on the Advanced tab, you can select different blendings.
These are difficult to describe, so your best bet is to try them and watch the small monitor to
see what effect you get.
You can do more things with the background, but we'll leave it at that for now and look at
something else: configuring styles and colors of the windows.


Chapter 11. Customizing Your X Environment
352
11.2.3.2.2 Configuring window styles and colors
With normal window managers, you can configure the color of the window decorations, but
not of the window contents. KDE is different. Since KDE is an integrated desktop, color and
other settings apply both to the window decorations painted by the window manager and to
the window contents painted by the applications. We'll now set off to configure a little bit of

the appearance.
In the control center, open the Look & Feel group, and choose Colors. You'll see a preview
window and a selection list where you can pick a color scheme. KDE does not work by
configuring individual colors, but by defining so-called color schemes. This is because it does
not make sense to change only one color; all colors must fit together to achieve a pleasing and
eye-friendly look.
While KDE lets you create your own color schemes, doing so is a task that requires some
knowledge about color psychology and human vision. We therefore suggest that you pick one
of the predefined color schemes. Check in the preview monitor whether you like what you
see. Now comes the fun part: click the Apply button and watch how all running applications
flicker a bit and suddenly change colors — without you having to restart them. While
Windows users tend to take this for granted, it was never seen on Unix before KDE.
The same feature applies to other settings. For example, open the Look & Feel group and
choose Style. Here, you can select among a large number of so-called styles. The styles
determine how the user interface elements are drawn — e.g., as in Windows (style Qt
Windows), as in Motif (style Qt Motif), as in RISC OS (style RISC OS), or even something
original as the "Light" styles. You can change this setting by clicking Apply and watch your
running applications change their style. The same goes, by the way, for the fonts that you can
select on the Font page.
11.2.3.2.3 Internationalization
There are many more things to configure in KDE, but we cannot go through all the options
here. Otherwise there would not be much space left for other topics in this book. But there's
one more thing that we'd like to show you. You will especially like this if English is not your
native language or if you frequently converse in another language.
Go to the Country & Language page in the Personalization group (see Figure 11-4). Here, you
can select the country settings and the language in which your KDE desktop and the KDE
applications should be running. Currently, KDE lets you choose from more than 80 country
settings and languages. Note that you need to have a language module installed in order to be
able to select a particular language. You can either download those from the KDE FTP server
(as explained earlier) or install them from your distribution media.





Chapter 11. Customizing Your X Environment
353
Figure 11-4. Configuring the language of the KDE desktop

You might be wondering why you can select more than one language. The reason is that
the KDE programs are translated by volunteers, and not all the applications are translated at
the same time. Thus, a particular application might not be available in the language that you
have chosen as your first language (the topmost one in the Language list). In this case,
the next language is chosen automatically for that application, and if no translation is
available for this application in that language either, the next language is chosen, and so on. If
all else fails, English is chosen, which always exists.
There is much more to say about using the KDE desktop, but we'll let you explore it yourself.
Besides the obvious and intuitive features, there are also some that are not so obvious but very
useful nevertheless, so be sure to check the documentation at

11.3 KDE Applications
Thousands of programs are available for KDE. They range from basic utilities (such as
konsole, the terminal emulator, and OClock, the clock) to editors to programming aids to
games to multimedia applications. The most we can provide here is a tiny slice of the software
available for KDE. In this section, we'll present those applications that all KDE users should
know how to use. These aren't necessarily the most exciting programs out there, but they
should certainly be part of your toolbox. Also remember that if there really is no KDE
program for a task you have to solve, you can always resort to one of the classic X
applications, if available. These will not look as nice and integrate as well, but will still work
on a KDE desktop.
Also, don't forget that there are many, many more KDE applications than the few we can list

here. You will make the acquaintance of some of them, like KWord, the word processor, and
Chapter 11. Customizing Your X Environment
354
KMail, the mail user agent, elsewhere in this book. But others, like the Personal Information
Manager KOrganizer, haven't found space in this book, so you should search through your
favorite Linux archive for more exciting KDE programs; there are hundreds of them to
discover.
11.3.1 konsole: Your Home Base
Let's start our exploration of X applications with the workhorse that you might be spending a
lot of your time within the terminal. This is simply a window that contains a Unix shell. It
displays a prompt, accepts commands, and scrolls like a terminal.

Traditionally, xterm was the classic Unix terminal emulator. It has been
superseded by konsole in the KDE desktop environment.

Perhaps you are struck by the irony of buying a high-resolution color monitor, installing
several megabytes of graphics software, and then being confronted by an emulation of an old
VT100 terminal. But Linux is simply not a point-and-click operating system. There are plenty
of nice graphical applications, but a lot of the time you'll want to manipulate text, and a
command-line interface still offers the most powerful tools for doing that.
So let's take look at a konsole window. Figure 11-5 shows one containing a few commands.
Figure 11-5. konsole window

11.3.1.1 Starting up konsole
You can start konsole in one of several ways, as all KDE programs:
• Start it from the panel, if you have a konsole icon there. This will be the default setup
with most distributions.

Select it from the K menu, where konsole can be found in Utilities/System/Konsole.
• Type Alt-F2, then in the small command window that opens, type "konsole."

• If you already have a konsole open, you can also type "konsole" there in order to get
another one.
Chapter 11. Customizing Your X Environment
355
When you open a konsole window, a "Tip of the Day" window will open that gives you useful
hints about using konsole. You can turn this off, but we suggest keeping it on for a while, as
you will learn many useful things this way. You can also read through all the tips by clicking
the Next button in that window repeatedly. Many KDE applications have such a Tip of the
Day.
konsole allows you to run several sessions in one konsole window. You can simply open a
new session by selecting a session type from the Session menu or by clicking the New toolbar
button. The toolbar or the View menu lets you then switch between sessions. If you don't see
any toolbar, select Settings/Show Toolbar from the menu to make it visible.
11.3.1.2 Cutting and pasting selections
Actually, konsole offers a good deal more than a VT100 terminal. One of its features is a
powerful cut-and-paste capability.
Take another look at Figure 11-5. Let's say we didn't really want the notes directory; we
wanted to look at ~/perl/_example/for_web_site instead.
First, we'll choose the part of the cd command that interests us. Put the mouse just to the left
of the
c
in
cd
. Press the left mouse button, and drag the mouse until it highlights the slash
following example. The result is shown in Figure 11-6.
Figure 11-6. Selected text in konsole

When the highlighted area covers just the right number of characters, click the middle button.
konsole pastes in what you've selected on the next command line. See the result in
Figure 11-7. Now you can type in the remainder of the directory name for_website and press

the Enter key to execute the command.





Chapter 11. Customizing Your X Environment
356
Figure 11-7. konsole window after text is pasted

You can select anything you want in the window — output as well as input. To select whole
words instead of characters, double-click the left mouse button. To select whole lines, triple-
click it. You can select multiple lines too. Selecting multiple lines is not useful when you're
entering commands but is convenient if you're using the vi editor and want to cut and paste a
lot of text between windows.
Be careful: if a long line wraps around, you will end up with a newline in the selection even
though you didn't press the Enter key when you entered the line.
Note that if you are more used to drag-and-drop style copying of text, konsole supports that as
well.
11.3.1.3 More konsole tricks
There are lots of things you can configure in konsole. You can select fonts, color schemes,
whether the scrollbar should be shown to the left, to the right, or not at all, and so on. The
most often-used settings are available in the Settings menu, and if you can't find what you are
looking for, go to Settings/Configure Konsole. There you can select the line spacing, whether
the cursor should blink, and so on.
A particularly useful feature in konsole is the ability to watch for output or silence in one of
the sessions. For this to work, you need to turn on the write daemon, which you do in the
aforementioned configuration dialog on the Write Daemon page.
What is the konsole watcher good for? Imagine that you are working on a large program that
takes a long time to compile. Non-programmers can imagine that you download a large file in

a terminal window with wget or that you are computing a complex POVRAY image. While
the compilation is running, you want to do something else (why do you have a multitasking
operating system, after all?) and start composing an email message to a friend in your KDE
mail client. Normally, you would have to check the console window every so often to see
whether compilation is finished and then continue to work on your program. With the
watcher, you can get a visual or audible notification when compilation completes. Simply
switch to the session you want to watch and select View/Monitor for Silence. You will get a
notification as soon as your compiler doesn't output any more messages for a while and can
divert your attention from your mail client back to your konsole window. Of course, you can
also watch for output instead of silence, which might be useful in long-running network
operations that don't show any progress indicators.
Chapter 11. Customizing Your X Environment
357
11.3.2 Clocks
How can your screen be complete if it is unadorned by a little clock that tells you how much
time you are wasting on customizing the screen's appearance? You can have a clock just the
way you want it, square or round, analog or digital, big or small. You can even make it chime.
KDE contains a number of clocks, but usually you will want to run the small panel applet, as
screen real estate is always at a premium, regardless of your screen resolution. The clock
should appear by default at the bottom-right corner of your screen, in the confines of the panel
(this is called a panel applet, or a small application that runs within the panel). If your
distribution hasn't set up things this way, you can also right-click anywhere on the panel
background and select Panel
Add Applet Clock from the menu, which will make
the clock appear on the panel. If you'd rather have it somewhere else on the panel, you can
right-click the small striped handle to the left of the clock, select Move from the context menu
that appears, and move the clock with the mouse to the desired position. Other panel objects
will automatically make room for the clock.
The panel clock applet has a number of different modes that you can select by right-clicking
the clock itself and selecting Type as well as the desired mode from the context menu. There

is a plain, a digital, an analog, and, most noteworthy, a fuzzy clock. The fuzzy clock is for
everybody who doesn't like being pushed around by his clock. For example, if you run the
fuzzy clock, it will show Middle of the week. If that is a bit too fuzzy for you, you can select
Preferences/Fuzzy Clock from the clock's context menu and select the degree of fuzziness
here. For example, I am typing this at 9:53 A.M. on a Thursday, and the four degrees of
fuzziness are Five to ten, Ten o' clock, Almost noon, and the aforementioned Middle of the
week.
The clock applet also lets you configure the date and time format to be used, as well as set the
system clock (you need root permissions to do that; if you are logged in as a normal user, a
dialog will pop up and ask you for the root password).
Finally, if you'd rather have a real big, traditional clock on the screen, you find a KDE version
of the classic "OClock" in the K menu at Utilities/OClock.
11.3.3 KGhostview: Displaying PostScript
Adobe PostScript, as a standard in its own right, has become one of the most popular formats
for exchanging documents in the computer world. Many academics distribute papers in
PostScript format. The Linux Documentation Project offers its manuals in PostScript form,
among others. This format is useful for people who lack the time to format input, or who have
sufficient network bandwidth for transferring the enormous files. When you create documents
of your own using groff or TEX, you'll want to view them on a screen before you use up
precious paper resources by printing them.
KGhostview, a KDE application, offers a pleasant environment for viewing PostScript on the
X Window System that, besides PostScript files, can also view files in Adobe's PDF.
KGhostview is really mostly a more convenient frontend to an older application, Ghostview,
so you can also get the functionality described here with Ghostview. The user experience is
much better with KGhostview, however, so that's what we'll be describing here.
Chapter 11. Customizing Your X Environment
358
Using KGhostview is very simple; invoke it with the name of the file to be displayed, for
instance:
eggplant$ kghostview article.ps

or simply click the icon of any PostScript or PDF file anywhere in KDE.
Since we are only concerned with viewing existing files here, we do not need to concern
ourselves much with the benefits of PostScript and PDF. Both can be considered standards to
the extent that many programs write them (and a few can read them), but both have been
defined by one company, Adobe Systems. PDF is a bit more portable and self-contained, as it
can even contain the fonts necessary to display the document. Also, PDF is better known on
Microsoft Windows and the Macintosh, so you are more likely to come across PDF files than
PostScript files on the Internet. And finally, while PostScript is really meant for printing, PDF
has some features for interactive viewing, such as page icons, hyperlinks, and the like.
KGhostview is not a perfect PDF viewer, even though it is sufficient for most documents. If
you have problems with a particular document, you may want to try either Adobe's own
Acrobat Reader (which is not free software, but can be downloaded at no cost from
www.adobe.com), or xpdf, which is probably included with your distribution.
The Ghostview window is huge; it can easily take up most of your screen. The first page of
the document is displayed with scrollbars, if necessary. There is a menu bar and a toolbar, as
in most KDE programs, as well as a page scroller and a page list on the left side of the
window.
Like most X applications, KGhostview offers both menu options and keys (accelerators) for
common functions. Thus, to view the next page, you can pull down the View menu and
choose the Next Page option. Or you can just press the PgDn key (or the Space key, if you
don't have a PgDn key, such as on a laptop).
4

To go back to the previous page, choose Previous Page from the View menu. To go to any
page you want, press the left mouse button on its number in the Page Number column. To
exit, choose Quit from the File menu, or just press Ctrl-q.
Documents from different countries often use different page sizes. The Ghostview default is
the standard U.S. letter size (but it can be overridden by comments in the PostScript file, and
this is often done by PostScript tools set up on Linux distributions that are configured for
European customs). You can select a different size from the Paper Size submenu in the View

menu.
Ghostview lets you enlarge or reduce the size of the page, a useful feature for checking the
details of your formatting work. (But be warned that fonts on the screen are different from the
fonts on a printer, and therefore the exact layout of characters in Ghostview will not be the
same as that in the hard copy.) To zoom in on a small part of the page, press Ctrl-+; to zoom


4
There is a subtle difference between the Space key and the PgDn key: the PgDn key will always take you to
the next page, while the Space key will first take you to the bottom of the current page if the window is too small
to display the whole page on the screen at once. A second press of the Space key will then take you to the next
page.
Chapter 11. Customizing Your X Environment
359
out, use Ctrl — . You can also use the toolbar buttons or the Zoom In/Zoom Out menu entries
in the View menu.
You can also adjust the window size to exactly fit the document's page width by selecting Fit
To Page Width from the View menu.
To print a page, choose Print from the File menu or press Ctrl-P anywhere in the window. The
standard KDE printer dialog will appear that lets you — among other things — choose the
printer to use.
You can also print only the current page or a range of pages; just specify your selection in the
printer dialog. This can also be combined with the PageMarks feature. The PageMarks menu
lets you mark and unmark individual or groups of pages. Marked pages are displayed with a
little red flag in the page list. If you have marked pages and select the printing functionality,
the dialog will pop up with the marked pages already filled in as the selection of pages to
print. Of course, you can override this setting before finally sending the document to the
printer.
11.3.4 Reading Documentation with Konqueror
Konqueror is not only a high-class web browser and file manager, but it also serves as a

documentation reader. KDE's documentation comes in HTML format anyway, but Konqueror
is capable of displaying other documentation formats like info and manpages. For example, in
order to show the manpage for the ls command, just open a mini command-line window by
pressing Alt-F2 and typing in that window:
man:ls
KDE will recognize that you want to read the manpage of the ls command, open a Konqueror
window, and display the manpage. The result is also much more nicely formatted than how
the original man command (or its X11 replacement xman) would do it.
This works similarly for Info pages. For example, the documentation of the GNU C Compiler
gcc comes in info format. Just type:
info:gcc
either in a mini command-line or in the Konqueror URL entry line, and the requested Info
page will pop up (assuming it is installed, of course). If you have cursed at the really user-
unfriendly command-line info program and weren't too happy with programs like xinfo either,
this feature may be a boon for you.
But Konqueror doesn't stop here when it comes to getting information. Want to use a search
engine on the Internet? To find pages about Tux (the Linux mascot) on, let's say, the
AltaVista search engine, simply type the following in a mini command-line or the Konqueror
URL entry line:
av:tux
Chapter 11. Customizing Your X Environment
360
and a Konqueror window with (at the time of this writing) 1,319,135 search results pops up.
This works with many other search engines as well. See Table 11-1 for some of the most
popular search engines together with their prefixes.
Table 11-1. Popular search engines and their prefixes
Search Engine Prefix
AltaVista
av:


Lycos
ly:
SourceForge
sf:

Excite
ex:
Google
gg:

If your favorite search engine is not configured (which is quite unlikely, actually), you can
configure it yourself by opening a Konqueror window and selecting Settings, Configure
Konqueror, and then Enhanced Browsing. The Enable Web Shortcuts section on that
configuration page contains all the preconfigured search engines and even lets you add your
own.
11.4 The GNOME Desktop Environment
The GNOME desktop environment was conceived in 1999 as an alternative to KDE, with its
roots in the GPL and LGPL. Like KDE, GNOME had the goal of providing modern, easy-to-
use applications that work with each other and with existing X applications.
We're going to give you a tour of GNOME the way it commonly looks, but you should be
aware that it's a general-purpose framework with really unlimited flexibility. For example, we
show the current window manager, Sawfish, but you can install a different window manager
with a completely different behavior and appearance. The GNOME libraries, as well as the X
libraries, underlie all the components, and have appeared in command-line and even server-
based applications as well as the graphical desktop. In addition, the GNOME project has
developed some powerful applications in typical areas of office work, such as spreadsheets
and address books. Any X application can run under GNOME (although it has to be written
with the GNOME framework to use the most powerful desktop features, such as the virtual
filesystem and themes). In particular, a lot of KDE applications work very nicely on GNOME,
and vice versa.

Of course, for our purposes, the interesting parts are the core desktop and its associated
applications. In the next sections, we'll go over the GNOME look and feel, talk a little bit
about the customization options it offers to you, and then give a quick tour of major
applications, such as Evolution and Gnumeric. But first, you'll want to make sure you have
the software and that it's up to date.
11.4.1 Installing and Updating GNOME
Most Linux distributions include GNOME, but if you haven't installed it yourself, or if you
want a newer version, you can visit for source and for
convenient binaries. Ximian offers a preassembled distribution of the desktop for the most
common Linux distributions. To install it, do the following:
Chapter 11. Customizing Your X Environment
361
1. Open a terminal window
2. Use the
su command to become root
3. Run the command:
lynx -source |sh

The command downloads a graphical installation program, shown in Figure 11-8. Follow the
on-screen instructions, and in a few minutes you'll have everything installed. The installer will
ask you to log out, and when you log back in, a wizard will guide you through the process of
setting some preferences for your new desktop.
Figure 11-8. Installing GNOME

Updates are also easy in GNOME: the Red Carpet utility (
red-carpet at the command line,
or click System, and then Get Software from the GNOME menu panel) checks for updates to
your entire system, including GNOME, and offers to install them for you. Software is divided
into neat channels — one for your distribution, another for the GNOME desktop, another for
additional software like the Opera web browser or the CodeWeavers WINE tools. When you

subscribe to a channel, Red Carpet will check for updates to the software that's on your
system from that channel. You can also add or remove software in each channel by choosing
the Update, Install, or Remove buttons along the upper-right corner of the channel windows.
11.4.2 Core Desktop Interface
The GNOME desktop is designed to be familiar to anyone who has used a computer before.
Although you can change the settings in almost any way, a typical installation will have a
desktop with icons on it and a panel along the top and bottom. The panels are among the most
important GNOME tools because they are so versatile and they allow a wide range of
interactions with your system. Panels can exist along one edge of your screen, like the
Windows control panel; along a portion of it, like the Macintosh Control Strip; in an arbitrary
position on the screen, like the NeXT dock; or in a combination of styles. They can contain
Chapter 11. Customizing Your X Environment
362
menus, buttons, and small applications or applets, such as clocks, window lists, network and
system monitors, and even tiny games.
A few features differ slightly from other graphical interfaces, such as the ability to have
multiple virtual workspaces (familiar to fvwm users, but not many others) and some of the
bells and whistles in the Nautilus file manager. We'll cover some of them in passing, but the
majority of them are small enough that you can discover them on your own.
Here is a quick explanation of how to perform the most common tasks. Once you get the hang
of these, you can probably guess how to do anything else.
Move items around on the desktop
Click and drag with the left mouse button.
Move items in the panel
Clicking and dragging with the left mouse button works for launchers, but for some
applets, the left mouse button is used to control the applet. In that case, middle-click
and drag. This is also the case for moving windows by their borders — left-click will
expand the window, but middle-click lets you move it.
Organize items on the desktop
Right-click the desktop background and select Clean Up by Name. Items will be

arranged in alphabetical order, with two exceptions: the first item, in the upper left, is
always your home directory, and the last item in the list is always the Trash folder.
Open or activate an item on the desktop
Double-click it. If you double-click a folder icon, it will open the folder in the Nautilus
file management tool. If you double-click a spreadsheet document, the Gnumeric
spreadsheet will start and open the document.
Open or activate an item in the panel
Click once with the left button.
Get a list of options or set preferences for any object
Click with the right mouse button to get a menu of available options for any object.
For example, you can change the desktop background by right-clicking it and
choosing Change Desktop Background. More general preferences are available in the
GNOME Control Center, which you can access by choosing System
Settings or
Applications
Desktop Preferences, or by typing gnome-control-center at the
command line.



Chapter 11. Customizing Your X Environment
363
Paste text into any text area
First, highlight the text you want to paste. Then, middle-click (if you have only two
mouse buttons, use both at once to emulate the middle button) in the area where you
want the text to go.
11.4.2.1 The panel
The preset configuration for many systems has a thin panel along the top and bottom of the
screen. The top panel has a set of menus along the upper left, and a few buttons and a clock at
the right. The bottom panel contains the window list applet, which should feel familiar to

users of Microsoft Windows.
To create a new panel, click any blank space in an existing panel, and choose Panel
Create
New Panel, then select the type of panel you would like. To change a panel's properties, such
as its size and color, right-click it and choose Properties (the menu panel at the top of the
screen has no available properties; it is preconfigured for one position and size). Experiment
with different kinds of panels and with different sizes to see which ones you like best. If you
use a smaller screen, like a laptop screen, you will want to choose a smaller panel size than if
you have plenty of screen real estate to use.
To add application launcher buttons to your panels, you can drag them from menus, or
right-click the panel and choose Panel
Add to Panel Launcher. Then, enter the name
of the application you want to run, and choose an icon. You may also choose a description of
the launcher that will display as a tool tip when you hover the mouse over the icon in your
panel. If you want to launch the application from a terminal, check the "Run in Terminal"
box.
For more information on the panel, right-click any empty spot in the panel and select Panel
Panel Manual.
Panel applets are small applications that run inside the panel. You can add them to the panel
from the Add to Panel menu or just run them by clicking Applications
Applets. Panel
applets come in a bewildering variety of flavors, from games to utilities. Some of the most
common are:
CPU Load
A graph that displays the load on your system resources for the past few seconds.
Workspace Switcher
In most installations, this applet will already be running when you log in, and is
typically set to four workspaces. Each workspace is the equivalent of a new screenful
of desktop space, and you can have as many as you like. The workspace switcher
displays all the virtual workspaces you have created, and displays each window on the

desktop as a tiny box. You can use the left mouse button to drag a window from one
workspace to another. Right-click and select the Properties menu item to change the
number or arrangement of workspaces.
Chapter 11. Customizing Your X Environment
364
Window List
Like the workspace applet, the Window List is included in most default
configurations. It displays the windows that you have open so that you can switch
easily among them, even when they are minimized. If you have multiple windows for
a single application, they will be grouped under a single entry. To turn this feature off,
or to set other options for the applet, right-click the Window List and select Properties.
Battery Charge Monitor
The Battery Charge Monitor displays the remaining battery life for laptop systems.
Options include display as a chart, as a percentage, or by estimated usage time
remaining.
SlashApp
Displays headlines from Slashdot or the GNOME News web site in your panel.
Eyes
The Eyes applet consists of a pair of eyeballs that follow your mouse around. It may
not be useful, but it's certainly amusing.
11.4.2.2 Nautilus: your desktop and file manager
Nautilus is the name of the GNOME desktop and file manager. It controls the display of your
background image and the files on your desktop, allows you to interact with files without
using a terminal, and keeps track of your trash for you. In other words, it's the GNOME
equivalent of Windows Explorer, the Macintosh Finder, and KDE's Konqueror.

In most cases, Nautilus will be running when you log in. If it isn't (you'll
know: your desktop will not have any icons on it), you can start it from
a terminal window by typing nautilus. If you decide you don't want
to run Nautilus at all, you can remove it from your session with the

Session Properties tool in the Control Center.

Like those other applications, Nautilus lets you drag items from one place to another. You can
also copy files using Ctrl-C, cut with Ctrl-X, and paste with Ctrl-V.
The quickest way to get started with Nautilus is to double-click the home icon in the upper-
left corner of your desktop, labeled as your home. This will open your home directory.

Normally, the files on your desktop are stored in ~/.gnome-desktop.
However, if you prefer to have your home directory be displayed on the
desktop, select Preferences, Edit Preferences, and under the Windows
and Desktop category check the "Use your home folder as your
desktop" checkbox.

Chapter 11. Customizing Your X Environment
365
Nautilus looks a good deal like a web browser, and in fact it can be used as one. At the top is
a toolbar with buttons that you can use to navigate through your directory structure: back,
forward, up, refresh, and home. The location bar, like in a web browser, describes the location
of the file or directory you're looking at in this window. If your username is
jdoe and you
click your Home icon, you'll see
/home/jdoe
in the location bar.
The left side of the Nautilus window appears to be blank. However, if you look on the lower-
left side, you'll notice tabs for Notes, Tree, Help, History, and News, as follows:

The Notes tool is a virtual pad of paper where you can jot down any quick reminders
you like.
• The Tree displays the directory tree for your system — click one of the triangles next
to a directory and it will spin down, showing you the contents. You can use this tool to

navigate your directory structure or to move items around quickly.

The Help tab offers up an index of several help systems — help pages for GNOME
and KDE applications, plus the more traditional man- and Info pages that come with
command-line Linux applications.

The History tab will help you trace your steps backward. Not sure where you left that
file? You can find out here.
• The News tab displays headlines that it pulls from various web sites. You can choose
your news sources and the frequency with which they update in the Preferences dialog
box.
Click a tab and it will expand to fill the sidebar.
Nautilus has some additional fun features that you won't find in other applications, as in:
• Instead of a generic image icon for graphics files, Nautilus uses scaled-down
thumbnails of the image itself. This makes it easy to organize directories full of
images, such as those pulled from a digital camera.
• If you hover your mouse over a music file, the file will begin to play.

For text files, the plain document icon is decorated by the actual text contents of the
file. That way, you can remember how the file starts without having to open it, even if
you didn't give it the most descriptive name.

You can stretch icons by right-clicking them and choosing Stretch Icon. If you stretch
a text icon enough, you can see the entire contents of the file, and use it as a desktop
notepad.
• Drag any image file onto the background of the left-hand sidebar, and the image will
be used as the sidebar background for that directory.

For most directories, you can choose to view their contents as a list, or as a group of
icons. However, some files have a wider range of options. For example, in a directory

full of audio files, you can choose View, and then View as Music, and play the sound
files in any order — Nautilus even shows you the artist, title, and playtime for
individual files. The same is true of HTML files: Nautilus can display them as their
source text or as fully rendered web pages.
All in all, Nautilus is a versatile tool that you can learn to use just by poking around a little.
For additional help, just choose Help, and then Nautilus User Manual from any Nautilus
window.
Chapter 11. Customizing Your X Environment
366
11.5 GNOME Applications
Now that you've got a feel for the desktop and how to get around it, let's take a look at some
of the applications that are built to go with it. Note that these applications aren't restricted to
the GNOME desktop, and they aren't the only applications you can run on the GNOME
desktop — they're just built from the same materials and work particularly well together.
11.5.1 Ximian Evolution: Mail, Calendar, and Contacts
Ximian Evolution is what's known as a groupware suite; it combines email with a calendar
and an address book so that communication and scheduling tasks all fall into one convenient
package. We haven't got room to go into depth with all three, but a complete manual is
included in the Help menu and is available online at .
You can start Evolution by selecting Evolution from your Applications menu, or by typing
evolution at the command line. A screen like the one in Figure 11-9 should come up.
Figure 11-9. Evolution on the GNOME desktop

The first time you run Evolution, you'll be asked to create an email account by entering
information about yourself and your email access. You can copy this information from your
existing mail program, or ask your system administrator or ISP.
Evolution works with standard mail server protocols and can be used in almost any network
environment. It lets you leave your mail on the server (the IMAP protocol), download mail to
your local system (the POP protocol), or use mail spools on your local system, if you're
running your own mail server. Ximian also sells a proprietary extension to Evolution called

Chapter 11. Customizing Your X Environment
367
Ximian Connector, which connects to Microsoft Exchange 2000 servers for more extensive
collaboration features.
Once you've created an account, you will be presented with the main Evolution window in its
Summary view. The Evolution summary provides you with exactly that: weather, news, a list
of upcoming tasks and appointments, and the number of new mail messages in your mail
folders.
On the left side of the Evolution window is a shortcut bar, with a list of several important
shortcuts. Click the buttons there to move to your Inbox, Contacts, or Calendar. For a
different view of the available resources, select View, and then Folder Bar. The folder bar
gives you a view that is more like a list of directories, and is especially useful if you have
created a large number of folders.
The following sections describe Evolution's three major features.
11.5.1.1 Evolution mail
To start using Evolution mail, click the Inbox button, or select any mail folder in the folder
bar. The mail view is divided into two portions: in the top half, a list of messages, and in the
bottom half, the display of your selected message. You can change the proportions by
dragging the gray bar between them.
In general, the mail features are fairly simple: click the Send and Receive button to check for
new mail and send mail you've queued for later delivery, and the New Message button to
compose a new message.
What distinguishes Evolution from other mail programs are the speed of its searches, the
power and simplicity of its filters, and its unique vFolders, a sort of combination of searches
and filters.
The search bar is located at the top of the message list. To search your mail, go to any mail
folder, select a portion of the message to search (just the message body, the sender, the entire
message, and so forth), enter a word into the text box, and press Enter. Evolution pre-indexes
your mail, so the results are returned to you faster than with other tools.
Filters add an action to the end of a search: every time you get mail, Evolution will perform a

search that you specify on the new messages, and then take actions based on those results.
The most common uses of filters are to automatically file messages based on the senders, and
to delete messages that are flagged as spam.
To create a filter, go to any mail view and open your list of filters by selecting Tools, and then
Filters. Then, do the following:
1. Click the Add button to add a filter.
2. In the top half of the dialog, select a set of criteria you'll use to pick messages for the
filter. For example, if you select Sender Contains in the first drop-down item, and
enter
gnome.org
in the text box that appears next to it, your filter will act on mail
that comes to you from all gnome.org email addresses.

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×