📄 ch22.htm
字号:
<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>
-->
<H1></H1>
<UL>
<LI><A HREF="#Heading1">- 22 -</A>
<UL>
<LI><A HREF="#Heading2">Configuring XFree86</A>
<UL>
<LI><A HREF="#Heading3">The XF86Config File</A>
<LI><A HREF="#Heading4">CAUTION</A>
<LI><A HREF="#Heading5">Modifying XF86Config</A>
<LI><A HREF="#Heading6">TIP</A>
<LI><A HREF="#Heading7">Examining the XF86Config File</A>
<UL>
<LI><A HREF="#Heading8">The Pathnames</A>
</UL>
<LI><A HREF="#Heading9">Listing 22.1. Font paths.</A>
<UL>
<LI><A HREF="#Heading10">The Keyboard Section</A>
</UL>
<LI><A HREF="#Heading11">Listing 22.2. Keyboard selection.</A>
<UL>
<LI><A HREF="#Heading12">The Pointer Section</A>
</UL>
<LI><A HREF="#Heading13">TIP</A>
<LI><A HREF="#Heading14">CAUTION</A>
<LI><A HREF="#Heading15">TIP</A>
<LI><A HREF="#Heading16">Listing 22.3. Mouse selection.</A>
<UL>
<LI><A HREF="#Heading17">The Server Section</A>
</UL>
<LI><A HREF="#Heading18">Listing 22.4. Server selection.</A>
<UL>
<LI><A HREF="#Heading19">Setting Up Video Modes</A>
</UL>
<LI><A HREF="#Heading20">NOTE</A>
<LI><A HREF="#Heading21">Listing 22.5. Common video modes.</A>
<UL>
<LI><A HREF="#Heading22">International Keyboard Layout for XFree86</A>
</UL>
<LI><A HREF="#Heading23">The .xinitrc File</A>
<LI><A HREF="#Heading24">Listing 22.6. A sample .xinitrc file.</A>
<LI><A HREF="#Heading25">The Personal X Resource File</A>
<LI><A HREF="#Heading26">NOTE</A>
<LI><A HREF="#Heading27">NOTE</A>
<LI><A HREF="#Heading28">Using xdm</A>
<LI><A HREF="#Heading29">Configuration of the Window Manager</A>
<LI><A HREF="#Heading30">Compiling Programs That Use X</A>
<LI><A HREF="#Heading31">TIP</A>
<LI><A HREF="#Heading32">CAUTION</A>
<LI><A HREF="#Heading33">TIP</A>
<LI><A HREF="#Heading34">Compiling Sources for XFree86</A>
<LI><A HREF="#Heading35">Configuring fvwm</A>
<LI><A HREF="#Heading36">TIP</A>
<UL>
<LI><A HREF="#Heading37">Pop-Up Menus</A>
</UL>
<LI><A HREF="#Heading38">Listing 22.7. An excerpt from an .fvwmrc file.</A>
<LI><A HREF="#Heading39">Listing 22.8. Calling one pop-up menu from another.</A>
<LI><A HREF="#Heading40">Listing 22.9. Verify that the user wants to quit.</A>
<UL>
<LI><A HREF="#Heading41">Startup</A>
</UL>
<LI><A HREF="#Heading42">Listing 22.10. The default InitFunction.</A>
<LI><A HREF="#Heading43">TIP</A>
<UL>
<LI><A HREF="#Heading44">Modules</A>
<UL>
<LI><A HREF="#Heading45">FIGURE 22.1.</A>
<LI><A HREF="#Heading46">FIGURE 22.2.</A>
</UL>
<LI><A HREF="#Heading47">Customization and Styles</A>
</UL>
<LI><A HREF="#Heading48">Listing 22.11. The default styles in fvwm.</A>
<UL>
<LI><A HREF="#Heading49">For More Information</A>
</UL>
<LI><A HREF="#Heading50">Summary</A>
</UL>
</UL>
</UL>
<P>
<HR SIZE="4">
<H2 ALIGN="CENTER"><A NAME="Heading1<FONT COLOR="#000077">- 22 -</FONT></H2>
<H2 ALIGN="CENTER"><A NAME="Heading2<FONT COLOR="#000077">Configuring XFree86</FONT></H2>
<P><I>by Kamran Husain</I></P>
<P>IN THIS CHAPTER</P>
<UL>
<LI>The XF86Config File
<P>
<LI>Modifying XF86Config
<P>
<LI>Examining the XF86Config File
<P>
<LI>The .xinitrc File
<P>
<LI>The Personal X Resource File
<P>
<LI>Using xdm
<P>
<LI>Configuration of the Window Manager
<P>
<LI>Compiling Programs That Use X
<P>
<LI>Compiling Sources for XFree86
<P>
<LI>Configuring fvwm
</UL>
<P>This chapter details the way to configure the X Window system for Linux. This
version of X Window for Linux is called XFree86 Version 3.1.2.</P>
<P>This chapter covers the following topics with regard to configuring your X Window
system:
<UL>
<LI>Working with the <TT>XF86Config</TT> file
<P>
<LI>What the <TT>.xinitrc</TT> file is
<P>
<LI>Your personal X resource file
<P>
<LI>Using xdm
<P>
<LI>Configuration of the window manager
</UL>
<H3 ALIGN="CENTER"><A NAME="Heading3<FONT COLOR="#000077">The XF86Config File</FONT></H3>
<P>In the preceding chapter you covered details of how to install X on your Linux
machine. Now, this chapter covers another one of the most difficult, time-consuming,
and frustrating parts of installing XFree86: setting up an <TT>XF86Config</TT> file.
To be able to set up an <TT>XF86Config</TT> file, you need to read the following
files from <TT>/usr/X386/lib/X11/etc</TT>: <TT>README</TT>, <TT>README.Config</TT>,
<TT>VideoModes.doc</TT>, and <TT>README.Linux</TT>. You also need to read the man
pages on the following topics: XF86Config, XFree86, XFree86kbd, and the server you
are using.</P>
<P>The <TT>XF86Config</TT> file is looked for by the X server in this order:
<UL>
<LI>In <TT>/usr/X386/lib/X11</TT>. This is the standard location for the sample <TT>XF86Config</TT>
file, but in some cases you cannot use it (for example, a read-only <TT>/usr</TT>
partition).
<P>
<LI>In <TT>/etc</TT>.
<P>
<LI>In your <TT>home</TT> directory.
<P>
<LI>As <TT>XF86Config.eg</TT> in <TT>/usr/X386/lib/X11</TT>.
</UL>
<P>There might be a link from one of the places in the preceding list to <TT>/usr/X386/lib/X11</TT>.</P>
<P>To give you some hints, here is a list of what you need in order to set up the
<TT>XF86Config</TT> file correctly:
<UL>
<LI>You have to select the server suitable for your system. To get a hint as to which
is the correct server, run the SuperProbe program that comes with XFree86. After
SuperProbe identifies your chip set, you can look at the <TT>XFree86-HOWTO</TT> file
on the CD-ROM at the back of this book to see which server supports this chip set.
Note that SuperProbe can detect far more hardware than XFree86 supports.
<P>
<LI>Your monitor's specifications, the most important of which are the maximum horizontal
and vertical scan frequency ranges and the bandwidth. This information can be obtained
from your monitor's datasheet.
<P>
<LI>The name of the chip set for your video card. For example, the name might be
WD/Paradise, Tseng Labs, ET3000, or ET4000.
<P>
<LI>The available dot clocks for your card or (if supported) the name of the programmable
dot clock generator. Learn how to obtain these by reading the file <TT>/usr/X386/lib/X11/doc/README.Config</TT>.
<P>
<LI>The mouse type. "Mouse type" refers to the protocol the mouse is using,
not to the manufacturer. For example, a serial Microsoft mouse connected to the PS/2
port uses the PS/2 protocol, not the Microsoft protocol.
<P>
<LI>The type of device your mouse is connected to: serial or bus. (Usually you can
use <TT>/dev/mouse</TT>.)
<P>
<LI>Whether you want to use a national keyboard map or whether you want to run the
generic U.S. key table.
</UL>
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading4<FONT COLOR="#000077"><B>CAUTION:</B> </FONT>Do not share
<TT>XF86Config</TT> files with people who do not have the same configuration (graphics
card and monitor). By sharing, you could fry your or their monitor. It isn't so hard
to figure out modes for multisync monitors. Don't ever use a mode that you haven't
verified as being within your monitor's specs. Even if you have exactly the same
setup as the computer you're sharing the file with, check all modes before trying
them. Many people run their computers from specs that don't damage their hardware
but could damage yours.
<HR>
</DL>
<H3 ALIGN="CENTER"><A NAME="Heading5<FONT COLOR="#000077">Modifying XF86Config</FONT></H3>
<P><TT>XF86Config</TT> is located in <TT>/usr/X386/lib/X11/XF86Config</TT>. In most
cases, you should be able to modify this file yourself. In the improbable, though
not unlikely, event that the specifications for your monitor and card are not readily
available, you might have to use the <TT>ConfigXF86</TT> and the <TT>xvidtune</TT>
utility from <TT>www.xfree86.org</TT>. See Chapter 21, "Installing XFree86."</P>
<P>The <TT>xvidtune</TT> utility provides an easy interface to the database of tested
graphics cards and monitors. It also has some tools for correctly configuring your
<TT>XF86Config</TT> file. The documentation and instructions for using <TT>xvidtune</TT>
are in an HTML file titled "Running <TT>xvidtune</TT>." This file is located
at</P>
<PRE><FONT COLOR="#0066FF">http://www.xfree86.org/3.2/QuickStart-6.html
</FONT></PRE>
<P>If the <TT>XF86Setup</TT> utility does not work just right for you, you will have
to modify the <TT>XF86Config</TT> file yourself. This manual modification is what
this section concentrates on. Also note that running the <TT>XF86Setup</TT> utility
overwrites changes to the <TT>XF86Config</TT> file and could possibly overwrite your
manual edits. So keep a backup copy of the <TT>XF86Config</TT> file as a precaution.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading6<FONT COLOR="#000077"><B>TIP:</B> </FONT>The XFree86 servers
parse the <TT>XF86Config</TT> file in case-insensitive mode, so don't worry about
capitalization.
<HR>
</DL>
<H3 ALIGN="CENTER"><A NAME="Heading7<FONT COLOR="#000077">Examining the XF86Config
File</FONT></H3>
<P>So now you have decided to modify the <TT>XF86Config</TT> file yourself. This
file contains all the configuration parameters for your X Window installation. Space
does not permit me to print the whole file. You will have to look in the directory
<TT>/usr/lib/X11</TT> for the <TT>XF86Config.eg </TT>file. Copy this <TT>XF86Config.eg
</TT>file to <TT>XF86Config</TT>. Then edit the <TT>XF86Config</TT> file. The format
of the <TT>XF86Config</TT> file consists of different sets that are listed in the
following sections:
<UL>
<LI>Pathnames to font files
<P>
<LI>Keyboard information
<P>
<LI>Mouse and pointer information
<P>
<LI>Monitor specifications
<P>
<LI>Device and screen modes
</UL>
<P>Each of these sections describes your hardware configuration, location of files,
or both, to the X server. Each section looks like this:</P>
<PRE><FONT COLOR="#0066FF">Section "SectionName"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -