⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch22.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 5 页
字号:


    Popup    "Modules"    Module-Popup



    Nop    ""



    Popup    "Exit Fvwm"    Quit-Verify



     Nop     ""



     Refresh "Refresh Screen"



EndPopup



</FONT></PRE>



<P>Of course, menu items don't always have to do something for them to work. The



<TT>Nop</TT> command does &quot;no operation.&quot; See the code in Listing 22.9



for the way fvwm quits back to a shell prompt. If the user selects the entry with



the title No, Don't Quit, no action is taken.



<CENTER>



<H3><A NAME="Heading40<FONT COLOR="#000077">Listing 22.9. Verify that the user



wants to quit.</FONT></H3>



</CENTER>



<PRE><FONT COLOR="#0066FF">



Popup &quot;Quit-Verify&quot;



    Title    &quot;Really Quit Fvwm?&quot;



    Quit    &quot;Yes, Bail me outta here &quot;



    Restart &quot;Restart Fvwm&quot;    fvwm



    Restart &quot;Start twm&quot;     twm



    Restart &quot;Start tvtwm&quot;     tvtwm



    Restart &quot;Start mwm&quot;     mwm



    Restart &quot;Start olvwm&quot;     /usr/openwin/bin/olvwm



    Restart &quot;Start olwm&quot;     /usr/openwin/bin/olwm



    Nop    &quot;&quot;



    Nop    &quot;No, Don't Quit&quot;



EndPopup



</FONT></PRE>



<P>One more thing. To get a horizontal bar in the menu entries, use the <TT>Nop</TT>



command with an empty string (<TT>&quot;&quot;</TT>). If you place a space in the



string (<TT>&quot; &quot;)</TT> an empty box is created instead. By using these two



alternatives, you can create pretty decent separators for menu items.



<CENTER>



<H4><A NAME="Heading41<FONT COLOR="#000077">Startup</FONT></H4>



</CENTER>



<P>The <TT>InitFunction</TT> function in fvwm is the routine that is called by fvwm



when it initializes itself. The use of the <TT>InitFunction</TT> in fvwm is analogous



to that of the <TT>.xinitrc</TT> file in xinit: all startup components and modules



are loaded with this function in fvwm. The default entry for fvwm is shown in Listing



22.10. You can uncomment each line to enable it.



<CENTER>



<H3><A NAME="Heading42<FONT COLOR="#000077">Listing 22.10. The default InitFunction.</FONT></H3>



</CENTER>



<PRE><FONT COLOR="#0066FF">



Function &quot;InitFunction&quot;



#    Module   &quot;I&quot;    FvwmBanner



#    Exec     &quot;I&quot;    xpmroot /usr/include/X11/pixmaps/fvwm.xpm &amp;



#    Module   &quot;I&quot;    GoodStuff



#    Module   &quot;I&quot;    FvwmPager 0 3



#    Exec     &quot;I&quot;    exec xterm -geometry 80x64+0+0 &amp;



#    Wait     &quot;I&quot;    xterm



#    Desk     &quot;I&quot;    0 2



#    Exec     &quot;I&quot;    exec xmh -font fixed -geometry 507x750+0+0 &amp;



#    Wait     &quot;I&quot;    xmh



#    Desk     &quot;I&quot;    0 0



EndFunction



</FONT></PRE>



<P>Each entry in the <TT>InitFunction</TT> generally consists of two lines. The second



line, if present, is a <TT>Wait</TT> function call. For example, a two-line entry



(often referred to as a &quot;stanza&quot;) takes the following form:</P>



<PRE><FONT COLOR="#0066FF">



    Exec    &quot;I&quot;    exec command options &amp;







    Wait    &quot;I&quot;    command



</FONT></PRE>



<P>The <TT>Wait</TT> command tells fvwm to wait until the command window is visible.



The <TT>Desk</TT> command forces fvwm to switch to a particular window on a desk.



By default, six virtual windows are available per desktop--two rows with three columns.



The <TT>Desk</TT> entry takes the desk and window of the virtual desktop to switch



to. The following lines fire up Netscape for me on the third window on desk 0 and



then switch back to the first desktop (desk 0, window 0) after the Netscape application



is visible. (See Chapter 61, &quot;Using Browsers,&quot; for information on how to



get Netscape for Linux.)</P>



<PRE><FONT COLOR="#0066FF">



    Desk    &quot;I&quot;    0 2



    Exec    &quot;I&quot;    exec netscape &amp;



    Wait    &quot;I&quot;    netscape



    Desk    &quot;I&quot;    0 0



</FONT></PRE>



<P>The <TT>Wait</TT> command is not necessary if all your initial programs are executed



on one window. The <TT>Wait</TT> command is required to force fvwm to wait for a



window to become fully visible on a desktop before switching to another desktop.







<DL>



	<DT></DT>



</DL>











<DL>



	<DD>



<HR>



<A NAME="Heading43<FONT COLOR="#000077"><B>TIP:</B> </FONT>The <TT>Exec</TT>,



	<TT>Wait</TT>, <TT>Desk</TT>, and <TT>Module</TT> commands require the <TT>&quot;I&quot;</TT>



	string as the first parameter for fvwm to work correctly. 



<HR>







</DL>







<CENTER>



<H4><A NAME="Heading44<FONT COLOR="#000077">Modules</FONT></H4>



</CENTER>



<P>A module is something that communicates with fvwm directly via pipes. Modules



cannot be executed directly and must be started from within fvwm. This lets fvwm



create bidirectional communication through the use of a UNIX pipe mechanism. Modules



enhance the functionality of fvwm.</P>



<P>The FvwmWinList opens a window with the list of all windows available to you on



a screen. Figure 22.1 shows the windows listed on my desktop.



<H6></H6>



<P><A NAME="Heading45<A HREF="../art/22/2201.jpg"><FONT COLOR="#000077">FIGURE



22.1.</FONT></A><FONT COLOR="#000077"> </FONT><I>The FvwmWinList module window.</I></P>



<P>Several other modules come with fvwm, including the Pager module, which is really



a big desk/virtual window manager, and FvwmBanner, which displays a pixmap as a background



when it starts up. The Pager module lets you create several desks, each with its



own set of virtual windows. (See Figure 22.2.)<BR>



<BR>



<A NAME="Heading46<A HREF="../art/22/2202.jpg"><FONT COLOR="#000077">FIGURE



22.2.</FONT></A><FONT COLOR="#000077"> </FONT><I>The Pager module default window.</I>



<CENTER>



<H4><A NAME="Heading47<FONT COLOR="#000077">Customization and Styles</FONT></H4>



</CENTER>



<CENTER>



<H4><FONT COLOR="#000077"></FONT></H4>



</CENTER>



<P>You can customize the appearance of fvwm with a choice of your own set of colors



instead of using the default values. Here is a list of the colors you can set in



your <TT>.fvwmrc</TT> file:







<UL>



	<LI><TT>StdForeColor</TT>: Foreground color for nonselected window titles and menu



	items.



	<P>



	<LI><TT>StdBackColor</TT>: Background color for nonselected window titles and menu



	items.



	<P>



	<LI><TT>StickyForeColor</TT>: Foreground color for nonselected sticky window titles.



	(Sticky windows always stay on the screen regardless of which desktop you happen



	to be on.)



	<P>



	<LI><TT>StickyBackColor</TT>: Background color for nonselected sticky window titles.



	<P>



	<LI><TT>HiForeColor</TT>: Foreground color for selected window titles.



	<P>



	<LI><TT>HiBackColor</TT>: Background color for selected window titles.



	<P>



	<LI><TT>MenuForeColor</TT>: Foreground color for menu items.



	<P>



	<LI><TT>MenuBackColor</TT>: Background color for menu items.



	<P>



	<LI><TT>MenuStippleColor</TT>: Background color for shaded menu items.



	<P>



	<LI><TT>PagerForeColor</TT>: Foreground color for virtual window pager.



	<P>



	<LI><TT>PagerBackColor</TT>: Background color for virtual window pager.



</UL>







<P>You can define colors either by using the names found in the <TT>/usr/lib/X11/rgb.txt</TT>



file or by specifying the red, green, and blue color components using the format</P>



<PRE><FONT COLOR="#0066FF">#RRGGBB



</FONT></PRE>



<P>where RR is the red component, GG is the green component, and BB is the blue component.



All components are hex values between <TT>0</TT> and <TT>255</TT> and are represented



as hex numbers. For example, the following definitions for a black color are equal:</P>



<PRE><FONT COLOR="#0066FF">StdForeColor black







StdForeColor #000000



</FONT></PRE>



<P>For a grayscale color, you could use either of the following statements:</P>



<PRE><FONT COLOR="#0066FF">MenuForeColor gray138







MenuForeColor #8a8a8a



</FONT></PRE>



<P>Colors are not the only way you can customize your desktop. A style is used to



define the type of a window. The way to define styles in fvwm is to use this syntax:</P>



<PRE><FONT COLOR="#0066FF">Style windowName options



</FONT></PRE>



<P>The windowName can be specified to use a specific window or can be used with a



wildcard. For example, with <TT>xclock</TT>, the style will apply only to applications



called xclock. The term <TT>*clock</TT> will cause fvwm to apply the style to all



applications whose names end with &quot;clock,&quot; such as oclock or xclock.</P>



<P>The options available for use with a style are listed here:







<UL>



	<LI><TT>Border</TT>/<TT>NoBorder</TT>: Specify whether to use a border.



	<P>



	<LI><TT>BorderWidth</TT>: Specify the width of the border, if there is a border.



	<P>



	<LI><TT>Title</TT>/<TT>NoTitle</TT>: Specify whether to use a title.



	<P>



	<LI><TT>StartsOnDesk </TT>#: Specify which desk to start on.



	<P>



	<LI><TT>Sticky</TT>: Make the window sticky.



	<P>



	<LI><TT>StaysOnTop</TT>: Always force this window to be active.



	<P>



	<LI><TT>Icon </TT>name: Use as icon pixmap.



	<P>



	<LI><TT>WindowListSkip</TT>: Don't list in lists for windows to tab over.



	<P>



	<LI><TT>CirculateSkip</TT>: Don't list in circular lists.



	<P>



	<LI><TT>SuppressIcons</TT>: Don't allow iconic version.



	<P>



	<LI><TT>NoHandles</TT>: Disable resizing capability.



	<P>



	<LI><TT>boundaryWidth</TT>/<TT>NoBoundaryWidth</TT>: Specify boundary width.



	<P>



	<LI><TT>StdForeColor</TT>: Set foreground color.



	<P>



	<LI><TT>StdBackColor</TT>: Set background color.



</UL>







<P>Listing 22.11 shows the styles that come as a default setup with the <TT>system.fvwmrc</TT>



file.



<CENTER>



<H3><A NAME="Heading48<FONT COLOR="#000077">Listing 22.11. The default styles



in fvwm.</FONT></H3>



</CENTER>



<PRE><FONT COLOR="#0066FF">



Style &quot;*&quot; BorderWidth 5, HandleWidth 5, Color Black/#60a0c0,Icon unknown1.xpm



Style &quot;Fvwm*&quot;       NoTitle, Sticky, WindowListSkip



Style &quot;Fvwm Pager&quot;  StaysOnTop



Style &quot;FvwmBanner&quot;  StaysOnTop



Style &quot;GoodStuff&quot;   NoTitle, NoHandles, Sticky, WindowListSkip, BorderWidth 0



Style &quot;*lock&quot;       NoTitle, NoHandles, Sticky, WindowListSkip



Style &quot;xbiff&quot;       NoTitle,            Sticky, WindowListSkip



Style &quot;Maker&quot;       StartsOnDesk 1



Style &quot;matlab&quot;      StartsOnDesk 3



Style &quot;signal&quot;      StartsOnDesk 3



Style &quot;rxvt&quot;        Icon  term.xpm



Style &quot;xterm&quot;       Icon xterm.xpm, Color black/grey



Style &quot;Appointment&quot; Icon datebook.xpm



Style &quot;xcalc&quot;       Icon xcalc.xpm



Style &quot;xbiff&quot;       Icon mail1.xpm



Style &quot;xmh&quot;         Icon mail1.xpm, StartsOnDesk 2



Style &quot;xman&quot;        Icon xman.xpm



Style &quot;xvgr&quot;        Icon graphs.xpm



Style &quot;matlab&quot;      Icon math4.xpm



Style &quot;xmag&quot;        Icon mag_glass.xpm



Style &quot;xgraph&quot;      Icon graphs.xpm



Style &quot;GoodStuff&quot;   Icon toolbox.xpm



</FONT></PRE>



<P>As you can see, several styles come with the fvwm to get you started. Just copy



the system-wide file over to your home directory, and edit away.



<CENTER>



<H4><A NAME="Heading49<FONT COLOR="#000077">For More Information</FONT></H4>



</CENTER>



<P>The man pages for fvwm provide a great deal of very specific information. There



are many other options and features for fvwm. Check the Web pages on the Internet



for more information on fvwm. Use <TT>&quot;fvwm&quot;</TT> or <TT>&quot;fvwm home



page&quot;</TT> as the string for search engines such as Yahoo!, Excite, or AltaVista.



I found more than 2,000 entries the last time I checked! Here are some of the pages



to look at as starting points:</P>



<PRE><FONT COLOR="#0066FF">



http://www.cs.hmu.edu/~tkelly/docs/fvwm.html



</FONT></PRE>



<PRE><FONT COLOR="#0066FF">http://www.cobaltgroup.com/~roland/fvwm/fvwm.html



</FONT></PRE>



<CENTER>



<H3><A NAME="Heading50<FONT COLOR="#000077">Summary</FONT></H3>



</CENTER>



<P>This chapter covered the topic of configuring the XFree86 system. After reading



this chapter, you should have an idea of how to set up your <TT>XF86Config</TT> file



to generate your X environment. Just remember to start with the basic configuration



settings for VGA cards and then make enhancements. Keep backups of your work, and



do not change the video settings unless you know what you're doing. If nothing works



despite your best efforts, you have the recourse of knowing where to look for answers



in FAQs, newsgroups, and FTP sites on the Internet for <TT>HOWTO</TT> and other documents



on Linux.



















</td>
</tr>
</table>

<!-- begin footer information -->



</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -