1. Trang chủ
  2. » Ngoại Ngữ

Running Linux phần 7 potx

41 259 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 41
Dung lượng 618,34 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

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 f

Trang 1

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 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

Ctrl-Alt-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

Trang 2

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 http://koffice.kde.org ), 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

Trang 3

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

Trang 4

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 http://www.kde.org is your one-stop shop for everything KDE-related, including documentation, screenshots, and download locations ftp://ftp.kde.org 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

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

Trang 5

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 http://koffice.kde.org

In addition to the packages mentioned here, which are officially provided by the KDE team, literally hundreds of other KDE programs are available See http://www.kde.org/applications.html 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

Trang 6

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

Trang 7

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

Trang 8

appears in the middle of the screen But, with a little more work, you can also integrate KDE applications into the K menu and the panel, which then displays icons that you can click

non-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 http://www.kde.org/documentation/index.html

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)

Trang 9

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

Trang 10

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

Trang 11

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 http://www.kde.org/documentation/index.html

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

Trang 12

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

Trang 13

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

Trang 14

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

Trang 15

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

Trang 16

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

Trang 17

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

Trang 18

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

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 http://gnome.org for source and http://ximian.com for

Trang 19

1 Open a terminal window

2 Use the su command to become root

3 Run the command: lynx -source http://go-gnome.com |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

Trang 20

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

Ngày đăng: 24/07/2014, 02:20

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN