?? 0103-0107.html
字號:
<HTML>
<HEAD>
<TITLE>Sams Teach Yourself Linux in 24 Hours:Using the X Window System:EarthWeb Inc.-</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311623 //-->
<!-- TITLE=Sams Teach Yourself Linux in 24 Hours//-->
<!-- AUTHOR=Bill Ball//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=07 //-->
<!-- PAGES=0103-0126 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="../ch06/0102-0102.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0108-0111.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-103"><P>Page 103</P></A>
<H3><A NAME="ch07_ 2">
Hour 7
</A></H3>
<H2>
<A NAME="ch07_ 3">
Using the X Window System
</A>
</H2>
<P>The X Window System installed on your computer, as you learned in
Hour 3, "Configuring the X Window System," is a port of X11 from the
XFree86 Project, Inc. This graphical interface includes about 3,500 files, with
nearly 200 programs (clients), more than 500 fonts, and more than 500
graphic image files in nearly 50 megabytes of software. You'll find nearly
everything (but not all files or programs) for X11 under the
/usr/X11R6 directory.
</P>
<P>This book doesn't have enough space to discuss all aspects of using X11
with Linux. This hour shows you some of the different graphical interfaces,
or window managers, you can use. It also discusses the different
terminal programs (or shell consoles) you'll find on your system. You'll learn some
of the basic operations you can perform while using X11, such as cutting
and pasting text, adjusting your mouse speeds or cursor shape, or doing
screen captures. The last section shows you a sampling of X11 clients you might
want to try.
</P>
<A NAME="PAGENUM-104"><P>Page 104</P></A>
<TABLE BGCOLOR=#FFFF99>
<TR><TD>JUST A MINUTE</TD></TR>
<TR><TD>
<BLOCKQUOTE>
that many clients, such as text editors, graphics programs, and even
other X11 Window managers, are discussed throughout this book.
</BLOCKQUOTE>
</TD></TR>
</TABLE>
<H3><A NAME="ch07_ 4">
X11 Window Managers
</A></H3>
<P>One of the great things about X11 is that you have freedom of choice in how you
would like to manage your windows and programs on your screen. This screen management
is through a window manager client. One of the bad things about X11 is that you have
a confusing choice of window managers, and you might be initially overwhelmed with
the array of configuration files, scripts, or resource settings.
</P>
<P>This section covers the window managers included on your CD-ROM. In Hour
8, "Exploring Other X11 Window Managers," I'll introduce you to other new and
exciting window managers you might want to try.
</P>
<P>You can customize nearly every aspect of how your windows look.
</P>
<H4><A NAME="ch07_ 5">
Configuring the fvwm2 Window Manager
</A></H4>
<P>The fvwm2 window manager, by Robert Nation, builds on window manager
improvements made by the fvwm window manager (discussed later). The window manager is set up
to provide an appearance similar to that of other operating systems (see Figure 7.1) with
a taskbar, hierarchical start menu, graphic icons, and three-dimensional window
buttons and scrollbar. You can construct custom start menus, or menus for the root window,
which are accessed by pressing the left mouse button on an empty space on the desktop. You
can also build a custom icon taskbar to run programs at the click of a button, and add
modules that add even more point-and-click functions (see the
fvwm2 manual page for a list of the modules and their manual pages).
</P>
<P>You'll find the fvwm2 window manager's configuration file,
system.fvwm2rc, in the /etc/X11/fvwm2 directory. You'll also find a symbolic link to the file, named
system.fvwm2rc, in the
/usr/X11R6/lib/X11/fvwm2 directory. If you're the root operator, you can customize this file
to support features and programs of your system for all users. If you'd like to make your
own custom fvwm2 features, copy the system.fvwm2rc file as
.fvwm2rc, and save it in your home directory.
</P>
<P>The main components of this file allow you to customize the following:
</P>
<UL>
<LI> Fonts for windows, icons, and menus
<LI> Window colors (background and foreground)
<LI> Operating modes (click in a window to activate it, or just move the cursor
over it, and so on)
</UL>
<A NAME="PAGENUM-105"><P>Page 105</P></A>
<UL>
<LI> Set how windows look
<LI> Tasks to do when starting up, such as setting the background color of
your desktop, and which modules to run
<LI> Menu definitions, so you can customize the list of programs to match
your system (a number of the programs defined in the default menus might not
be installed on your system)
<LI> Your mouse buttons' default operation or menus in the desktop, or you
can define function-key utilities<BR>
</UL>
<P>Figure 7.1.<BR>
The fvwm2 window<BR> manager for X11<BR> under Linux
offers<BR> decorative window<BR> borders and controls.<BR>
<a href="javascript:displayWindow('images/ch07fg01.jpg', 288, 216)"><img src="images/tn_ch07fg01.jpg"></a><BR>
</P>
<P>If you find you like the fvwm2 window manager, you might also want to
try AnotherLevel, a sophisticated customization of
fvwm2's configuration files.
</P>
<P><B>
Configuring AnotherLevel
</B></P>
<P>A more complex variant of the fvwm2 window manager is AnotherLevel, based on Greg
J. Badros' TheNextLevel, which uses the fvwm2 window manager. The AnotherLevel
fvwm2 window manager configuration is the default X11 desktop for Red Hat Linux. You'll
find an almost overwhelmingly complete menu system, and you can customize nearly any
aspect of how your windows look, or how the window manager handles your keyboard or mouse.
</P>
<P>Figure 7.2 shows the fvwm2 AnotherLevel window manager.
</P>
<A NAME="PAGENUM-106"><P>Page 106</P></A>
<P>Figure 7.2.<BR>
The fvwm2<BR> AnotherLevel window<BR> manager
configuration<BR> comes with a set of<BR> files you can use
to<BR> customize its windowing system.<BR>
<a href="javascript:displayWindow('images/ch07fg02.jpg', 288, 216)"><img src="images/tn_ch07fg02.jpg"></a><BR>
</P>
<P>Unlike fvwm, fvwm2's AnotherLevel has several configuration files, found under the
/etc/X11/AnotherLevel directory. These files include
</P>
<!-- CODE //-->
<PRE>
# ls -A /etc/X11/An*
decors fvwm2rc.forms fvwm2rc.m4 fvwm2rc.xlock
fvwm2rc.apps fvwm2rc.functions fvwm2rc.macros scripts
fvwm2rc.decors fvwm2rc.hostmenus fvwm2rc.menus
fvwm2rc.defines fvwm2rc.init fvwm2rc.modules
fvwm2rc.defstyles fvwm2rc.keys fvwm2rc.mouse
</PRE>
<!-- END CODE //-->
<P>If you're the root operator, you can make changes in these files to customize how
this window manager will work for all your users. These files contain many different
definitions you can change, including the following:
</P>
<UL>
<LI> Color options for menubars and menu items
<LI> Options for enabling sounds
<LI> Software toggles and switches for using icons, or color in menus
<LI> Customized mouse and window operations, such as focus (whether a window
is made active by mouse click or cursor location)
<LI> Definitions for the number of virtual desktops
<LI> Support for Windows 95 keyboards
<LI> Options for tear-off menus
</UL>
<A NAME="PAGENUM-107"><P>Page 107</P></A>
<P>For customizing the applications supported in the window manager menus, you'll want
to use the wmconfig program, found under the
/usr/X11R6/bin directory. This program builds a window manager configuration file from definition files found under the
/etc/X11/wmconfig directory. You can build configuration files for several window managers using
this program.
</P>
<P>First, create a directory called .wmconfig in your home directory. Then copy the files in
the /etc/X11/wmconfig directory into your
.wmconfig directory, for example:
</P>
<!-- CODE SNIP //-->
<PRE>
# mkdir .wmconfig
# cp /etc/X11/wmconfig/* .wmconfig
</PRE>
<!-- END CODE SNIP //-->
<P>You can then add, delete, or change the applications in the menus by creating,
editing, or deleting the configuration files. For details concerning the format of these files, see
the wmconfig manual page. When you've finished customizing the applications and menus,
you can create a new configuration file using the
wmconfig command, for example:
</P>
<!-- CODE SNIP //-->
<PRE>
# wmconfig --output=fvwm2 --sysdir=/home/bball/.wmconfig >.fvwm2rc
</PRE>
<!-- END CODE SNIP //-->
<P>This command line will cause the wmconfig program to parse the configuration
files found under the .wmconfig directory and place the output in a new
.fvwm2rc file.
</P>
<P>If you like to use the taskbar at the bottom of the screen, but need the screen real
estate, and don't want the taskbar to get in the way when you're working, you make it
automatically hide by changing the settings in the
fvwm2rc.modules file. Look for the section dealing with
the taskbar, for example:
</P>
<!-- CODE SNIP //-->
<PRE>
########################################################################
######## FvwmTaskBar
*FvwmTaskBarAutoHide
</PRE>
<!-- END CODE SNIP //-->
<P>After you add the auto-hide setting, restart the window manager. The taskbar will
disappear when you don't need it, but will appear when your mouse cursor is at the bottom of
the screen.
</P>
<P>You can also start programs from the
fvwm2rc.init file. Although you can start programs
by adding them to your .xinitrc file, it is important to add them to the
fvwm2rc.init file if you want the programs' windows to have special features, such as visible minimize, maximize,
or close buttons. Look for the SetupFunction section, then add the programs you'd like to
run at startup, as follows:
</P>
<!-- CODE //-->
<PRE>
# SetupFunction gets run at Init and Restart
AddToFunc "SetupFunction"
+ "I" Exec xsetroot -solid cyan4
+ "I" Exec rxvt -geometry 80x11+3+375 -bg white -fg black
</PRE>
<!-- END CODE //-->
<P><CENTER>
<a href="../ch06/0102-0102.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0108-0111.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -