ch02.xml.pdf
(
792 KB
)
Pobierz
In this chapter:
• Introduction to
Windowing
• Starting X
• Running Programs
• Working with a
Mouse
• Working with
Windows
• Other Window
Manager Features
• Unresponsive
Windows
• Other X Window
Programs
• Quitting
2
Using Window
Systems
All versions of Unix work with alphanumeric terminals that handle a sin-
gle session in a single screen, such as those described in Chapter 1. On
most modern Unix versions, you can also use a
window system.
A window
system is software that lets a single screen handle many sessions at once.
*
Window systems use a mouse or another device (such as a trackball) to
move a
pointer
across the screen. The pointer can be used to select and
move parts of the screen, copy and paste text, work with menus of com-
mands, and more. If you’ve used a Macintosh or Microsoft Windows,
among others, you’ve used a window system. Figure 2-1 shows a typical
screen with windows.
This chapter introduces the X Window System, which is called X for short,
the most common Unix window system. This introduction should also
help you use window systems other than X.
*
If you’re using a PC operating system, such as Linux or NetBSD, your system probably also
supports
virtual consoles.
See the Glossary for a definition and more information.
17
7 January 2002 13:11
18
Chapter 2: Using Window Systems
Introduction to Windowing
Like Unix, X is very flexible. The appearance of windows, the way menus
and icons work, as well as other features, are controlled by a program
called the
window manager.
There are many different window managers;
some have many features and “eye candy,” while others are simple and
have just basic features. A window manager can make your desktop look
a lot like a Macintosh or Microsoft Windows system, or it can look com-
pletely different. Your system may also have an optional
desktop environ-
ment
that provides even more features, such as support for “drag and
drop” (for example, printing a file by dragging its icon onto a printer
icon). Two popular desktop environments are GNOME and KDE. In this
chapter, we show GNOME with the Sawfish window manager, as well as
KDE with the kwm window manager. Details of other window managers,
including how they make your screen look, are somewhat different—but
this chapter should help you use them, too.
Image
Window
Browser
Window
Desktop
Icons
Control
Window
Terminal
Window
Menu
Icon
Program Icons
Window Control Buttons
Pager
(for Virtual Desktops)
Figur e 2-1. An X scr een with KDE and kwm
7 January 2002 13:11
Starting X
19
Starting X
There are several ways to start X and its window manager. This section
explains a few common ways. Figure 2-2 shows some steps along a few
different paths to starting X. (The large “X” on the figures is the mouse
pointer, or cursor, that you may see on your screen.) If your screen is like
any of the following, refer to the section noted. If none fits your situation,
skim through the next three sections or ask another X user for help.
•
Figure 2-2A,
xdm
(or another program, such as
gdm
or
kdm)
is run-
ning and waiting for you to log in graphically. Start reading at Section
A.
Figure 2-2B has a standard Unix login session; the X Window System
is not running. Start reading at Section B.
Figure 2-2C shows X running, but a window manager probably isn’t.
(You can tell because the window doesn’t have a
frame
around it:
there’s no titlebar or border.) Read Section C.
Figure 2-2D shows the window with a frame (titlebar and border), so
X and the window manager (in this example,
mwm)
are running.
You’re ready to go! Skip ahead to the section “Running Programs.”
•
•
•
A. Ready to Run X (with a Graphical Login)
Some terminals, like the one whose screen is shown in Figure 2-2A, are
ready to use X. Your terminal has probably been set up to use one of the
X display managers called
xdm, gdm, kdm,
or others; these log you in to
your account and usually also start the window manager.
When you start, there’s a single window in the middle of the screen that
has two prompts like “login:” and “password:”. The cursor sits to the right
of the “login:” line. To log in, type your username (login name) and press
RETURN , then do the same for your password. The login window disap-
pears.
If a screen something like Figure 2-1 or Figure 2-2D appears, you’re ready
to use X. You can skip ahead to “the section “Running Programs.”
If you get a screen such as Figure 2-2C (a single window with no title and
no border), read Section C. Or, if you get a blank screen, press and
release your mouse buttons one by one, slowly, to see if a menu pops up.
7 January 2002 13:11
20
Chapter 2: Using Window Systems
A
B
login:
john
Password:
X Window System
$
xinit
Login:
Password:
C
D
xterm
$
$
Figur e 2-2. Four scenarios that may occur while starting X
B. Starting X from a Standard Unix Session
If your terminal shows something like Figure 2-2B, with a standard Unix
“login:” prompt (not in a separate window; the display fills the whole
screen, making it look like a terminal), X isn’t running. Log in (as the sec-
tion “Logging in Nongraphically” in Chapter 1 explains) and get a shell
prompt (such as
$
or
%
). Next, you need to start X. Try this command first:
$
startx
If that doesn’t seem to work (after waiting a minute or so; X can be slow
to start), try the command
xinit
instead. If all goes well, your screen
sprouts at least one window. If the window looks like Figure 2-2C, with-
out a titlebar or border from a window manager, read Section C. Other-
wise, your window manager is running, so skip ahead to the section
“Running Programs.”
7 January 2002 13:11
Running Programs
21
Problem checklist
No windows open. I get the message “Fatal server error: No screens found.”
Your terminal may not be able to run X. Try another terminal or ask a
local expert.
C. Starting the Window Manager
Once you have a window open with a shell prompt in it (usually
$
or
%
),
you can start the window manager program. If a window manager isn’t
running, windows won’t have frames (with titles, control boxes, and so
on). Also, if you move the pointer outside any window (to the desktop)
and press the mouse buttons, menus won’t appear unless the window
manager is running. If you have to start the window manager by hand,
your account probably hasn’t been set up correctly. To make your life eas-
ier, get help from an X-pert and fix your account!
If you need to start the window manager by hand, move your pointer into
the terminal window. At the shell prompt, type the name of your window
manager, followed by an ampersand (
&
). If you don’t know your window
manager’s name, try the following names, one by one, until one works
(i.e., doesn’t give you a “command not found” error):
gnome-session,
startkde, wmaker, afterstep, fvwm2, fvwm,
or
twm.
For example:
$
fvwm &
[1] 12345
$
In a few moments, the window should have a frame. (For more about
starting programs, see the section “Terminal Windows,” later in this chap-
ter.)
Running Programs
A window manager can open windows of its own. But the main use of a
window manager is to manage windows opened by other programs. We
mention a few window programs here; the section “Other X Window Pro-
grams,” near the end of this chapter, has more.
7 January 2002 13:11
Plik z chomika:
musli_com
Inne pliki z tego folderu:
ch01.xml.pdf
(407 KB)
ch00.xml.pdf
(52 KB)
ch02.xml.pdf
(792 KB)
ch03.xml.pdf
(477 KB)
ch06.xml.pdf
(578 KB)
Inne foldery tego chomika:
5 Livre LINUX Maîtrisez l'administration du système By Ultimatium
BSD & Unix
Cluster
cobaltstrike
Collection_4_E-Books_Linux_Debian
Zgłoś jeśli
naruszono regulamin