?? 168-172.html
字號:
<HTML>
<HEAD>
<TITLE>Linux Configuration and Installation:Installing and Configuring XFree86</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=1558285660//-->
<!--TITLE=Linux Configuration and Installation//-->
<!--AUTHOR=Patrick Volkerding//-->
<!--AUTHOR=Kevin Reichard//-->
<!--AUTHOR=Eric Foster//-->
<!--PUBLISHER=IDG Books Worldwide, Inc.//-->
<!--IMPRINT=M & T Books//-->
<!--CHAPTER=3//-->
<!--PAGES=168-172//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="164-168.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="172-193.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading37"></A><FONT COLOR="#000077">Configuring Fonts and Colors</FONT></H4>
<P>The foremost area you’ll likely customize in the <B>.fvwmrc</B> file is fonts and colors.</P>
<P>Each window manager, including <B>fvwm</B>, allows only one application at a time to get keyboard input. This window, usually called the <I>active window</I> or the <I>keyboard focus window</I>, is usually highlighted by the window manager. In the <B>.fvwmrc</B> file, the <I>HiForeColor</I> sets the text foreground color for the active window’s title. The <I>HiBackColor</I> sets the active titlebar color. The <I>StdForeColor</I> and <I>StdBackColor</I> work similarly for nonactive windows.</P>
<P>We use the following colors (copied from the default <B>.fvwmrc</B> file):</P>
<!-- CODE SNIP //-->
<PRE>
StdForeColor Black
StdBackColor #60a0c0
# this is used for the selected window
HiForeColor Black
HiBackColor #c06077
</PRE>
<!-- END CODE SNIP //-->
<P>Window managers usually support two policies for selecting which window is made active: <I>click-to-focus</I> and <I>focus-follows-mouse</I>. Few people agree on which is better (Microsoft has decided click-to-focus is better, though). Choose the mode you want.</P>
<P>If you want focus-follows-mouse, ensure that the following line is commented out:</P>
<!-- CODE SNIP //-->
<PRE>
#ClickToFocus
</PRE>
<!-- END CODE SNIP //-->
<P>If you want click-to-focus, then uncomment (remove the <TT>#</TT> character) the same line:</P>
<!-- CODE SNIP //-->
<PRE>
ClickToFocus
</PRE>
<!-- END CODE SNIP //-->
<P>For fonts, you can control a number of the fonts used by <B>fvwm</B>:</P>
<!-- CODE SNIP //-->
<PRE>
Font -adobe-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*
#Font -*-times-medium-i-*-*-*-140-*-*-*-*-*-*
WindowFont -adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*
#IconFont -adobe-helvetica-medium-r-*-*-11-*-*-*-*-*-*-*
IconFont fixed
</PRE>
<!-- END CODE SNIP //-->
<P>The asterisks (*) in the font names are wildcards. We only specify the minimum amount of data necessary to get Helvetica fonts at 10 and 12 point. A few fonts are commented out. You can uncomment these lines (and comment out the corresponding line) to try these other fonts, or type in your own font names.
</P>
<P>By default, <B>fvwm</B> asks you to place each new window that appears on the screen. This can be a real pain, so we usually ask <B>fvwm</B> to place windows for us—you can always move them later—by setting the oddly named RandomPlacement option. Uncomment the following line to get this effect:</P>
<!-- CODE SNIP //-->
<PRE>
RandomPlacement
</PRE>
<!-- END CODE SNIP //-->
<P>You also need to comment out the following line:
</P>
<!-- CODE SNIP //-->
<PRE>
#NoPPosition
</PRE>
<!-- END CODE SNIP //-->
<P>By default, <B>fvwm</B> places no border around dialog windows (called <I>transient windows</I> in X terminology). To make <B>fvwm</B> act more like the Motif window manager, uncomment the following line:</P>
<!-- CODE SNIP //-->
<PRE>
# If you want decorated transient windows,
# uncomment this:
# Ensure that a titlebar appears on dialogs.
DecorateTransients
</PRE>
<!-- END CODE SNIP //-->
<H4 ALIGN="LEFT"><A NAME="Heading38"></A><FONT COLOR="#000077">Testing Your Fvwm Configuration</FONT></H4>
<P>Now that we’ve made a change to our <B>.fvwmrc</B> file, it’s time to test our new configuration. To do this, you need to restart <B>fvwm</B>. You can either quit X and restart everything or call up <B>Fvwm</B>’s root window menu, where you’ll find a <B>Restart fvwm</B> choice. (It may be on a submenu.) You can access <B>fvwm</B>’s root menu by holding down the left mouse button over the screen background.</P>
<P><FONT SIZE="+1"><B>Turning off the Virtual Desktop</B></FONT></P>
<P>Both XFree86 and <B>fvwm</B> provide the ability to use <I>virtual screen space</I>, screen space beyond the confines of your monitor’s resolution. XFree86 calls this a <I>virtual screen</I>, and <B>fvwm</B> calls this a <I>virtual desktop</I>.</P>
<P>These two methods tend to conflict, and frankly, we don’t have much use for either kind of virtual screen space, as we don’t run that many X applications at once and we can iconify windows to get them out of the way. Furthermore, it’s easy to accidentally warp to one of <B>fvwm</B>’s virtual desktop spaces, which tends to get annoying.</P>
<P>Because of all this, we turn off <B>fvwm</B>’s virtual desktop in our <B>.fvwmrc</B> file with the following:</P>
<!-- CODE SNIP //-->
<PRE>
DeskTopSize 1x1
</PRE>
<!-- END CODE SNIP //-->
<P>You specify the desktop value in units of the screen size; <I>1×1</I> means no virtual desktop.</P>
<H4 ALIGN="LEFT"><A NAME="Heading39"></A><FONT COLOR="#000077">Placing Icons</FONT></H4>
<P><B>Fvwm</B>’s defaults result in bizarrely placed icons, with hidden icons strewn throughout the screen. We want to change this. To do so, use the <I>IconBox</I> command in the <B>.fvwmrc</B> file. We like our icons to go across the top of the screen, but we start from an offset of about 130 pixels to leave room for the round <B>oclock</B> window we place in the upper-left corner of the screen. (See our <B>.xinitrc</B> file, listed earlier.)</P>
<P>The <I>IconBox</I> specifies a rectangular area where you want the icons to appear. Here’s our area:</P>
<!-- CODE SNIP //-->
<PRE>
IconBox 130 5 600 15
</PRE>
<!-- END CODE SNIP //-->
<H4 ALIGN="LEFT"><A NAME="Heading40"></A><FONT COLOR="#000077">Configuring the Good Stuff</FONT></H4>
<P><B>Fvwm</B> also supports something called <I>modules</I>, add-ons that you can configure and run. The most popular add-on is called <I>GoodStuff</I>; it places a window on your screen from which you can launch applications or menus, sort of like a toolbar or the Windows 95 command area at the bottom of the screen.</P>
<P>Then you can turn on GoodStuff by uncommenting the GoodStuff lines in the <I>InitFunction</I> and <I>RestartFunctions</I> sections:</P>
<!-- CODE //-->
<PRE>
Function "InitFunction"
#Module "I" FvwmBanner
#Exec "I" xpmroot /usr/include/X11/pixmaps/fvwm.xpm &
Module "I" GoodStuff
#Module "I" FvwmPager 0 3
#Exec "I" exec xterm -geometry 80x64+0+0 &
#Wait "I" xterm
#Desk "I" 0 2
#Exec "I" exec xmh -font fixed -geometry 507x750+0+0 &
#Wait "I" xmh
#Desk "I" 0 0
EndFunction
#Exec "I" xsetroot -solid "#266294"
Module "I" GoodStuff
#Module "I" FvwmPager 0 3
EndFunction
</PRE>
<!-- END CODE //-->
<P>Either way works. The <I>InitFunction</I> section allows you to specify a set of X applications to launch at <B>fvwm</B> startup. Because this overlaps with the <B>.xinitrc</B> file, we typically skip starting any applications in the <I>InitFunction</I> section.</P>
<P><FONT SIZE="+1"><B>Toward a Motif-Like Look and Feel</B></FONT></P>
<P>One of <B>fvwm</B>’s claims to fame is that it is a free window manager that looks a lot like the Motif window manager, <B>mwm</B>, used on just about every commercial version of UNIX. Unfortunately, while <B>fvwm</B> looks like Motif, it doesn’t act as much like <B>mwm</B> as you’d expect. The similar look of <B>fvwm</B> can fool you.</P>
<P>Take heart, though, as there are a few things you can do to make <B>fvwm</B> act more like <B>mwm</B>. Take a look at our <B>.fvwmrc</B> file, later, and you’ll see a lot of <B>mwm</B>-like behavior.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="164-168.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="172-193.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -