📄 164-168.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=164-168//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="161-164.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="168-172.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading34"></A><FONT COLOR="#000077">Setting a Screen Background Image</FONT></H4>
<P>In X, you can display a bitmap image, a solid color, or a graphics file as your screen background, depending on the program you use to accomplish this task.
</P>
<P>The <B>xsetroot</B> program sets the screen background color. It can also set the screen background to a monochrome bitmap. Our <B>.xinitrc</B> file sets the background color to SteelBlue. Other good screen background colors include bisque3 and MediumTurquoise. You can see the whole list of X color names in the text file <B>/usr/lib/X11/rgb.txt</B>. This file contains a number of entries, including:</P>
<!-- CODE SNIP //-->
<PRE>
255 239 213 PapayaWhip
255 235 205 BlanchedAlmond
50 205 50 LimeGreen
</PRE>
<!-- END CODE SNIP //-->
<P>The <B>xsetroot</B> program can also be used to set the screen background to a monochrome bitmap, stored in an X bitmap file. The syntax for setting the screen background to a bitmap is:</P>
<!-- CODE SNIP //-->
<PRE>
gilbert:/$ xsetroot -bitmap filename -fg fore -bg back
</PRE>
<!-- END CODE SNIP //-->
<P>where <I>filename</I> is the name of the file containing the bitmap and the <I>fore</I> and <I>back</I> are optional parameters that set the image’s foreground and background color, respectively. Use the color names from the <B>rgb.txt</B> file explained earlier.</P>
<P>For example, if you have an X bitmap file named <B>prisoner.xb</B>, you can set it to be tiled over the screen background with the following command:</P>
<!-- CODE SNIP //-->
<PRE>
gilbert:/$ xsetroot -bitmap prisoner.xb
</PRE>
<!-- END CODE SNIP //-->
<P>You’ll see a screen like that shown in Figure 3.8.
</P>
<P><A NAME="Fig8"></A><A HREF="javascript:displayWindow('images/03-08.jpg',879,608 )"><IMG SRC="images/03-08t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/03-08.jpg',879,608)"><FONT COLOR="#000077"><B>Figure 3.8</B></FONT></A> Using a bitmap as the screen background.</P>
<P>Because the image looks good in black and white, we skip the <I>-fg</I> and <I>-bg</I> options to <B>xsetroot</B> (and leave the famous penny-farthing bicycle alone).</P>
<P>If, instead of an X bitmap file, you have a GIF, TIFF, or JPEG image, you can use <B>xv</B> to display the image. <B>Xv</B> is a very neat image and file manager that sports the ability to convert images from one format to another and a way cool Visual Schnauzer. Normally, you display images in <B>xv</B>’s window, but it can also display images on the screen background, also called the <I>root window</I>.</P>
<P>For <B>xv</B>, use the following syntax to display an image on the root window:</P>
<!-- CODE SNIP //-->
<PRE>
gilbert:/$ xv -quit -root -max filename
</PRE>
<!-- END CODE SNIP //-->
<P>where <I>filename</I> is the name of the file you want to display. When you run this command on an image file, you’ll see a result like the one in Figure 3.9.</P>
<P><A NAME="Fig9"></A><A HREF="javascript:displayWindow('images/03-09.jpg',996,531 )"><IMG SRC="images/03-09t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/03-09.jpg',996,531)"><FONT COLOR="#000077"><B>Figure 3.9</B></FONT></A> Using <B>xv</B> to set an image file for the screen background.
</P>
<P>With complicated color images, you can soon fill up your colormap from the screen background image. This may lead to color flashing as X programs run out of colors in the default colormap and therefore create their own colormaps.
</P>
<H3><A NAME="Heading35"></A><FONT COLOR="#000077">The Fvwm Window Manager</FONT></H3>
<P>The window manager is one of the most important applications you’ll run, as it sits around every application window on the screen and can influence how the windows work. The de facto window manager for Linux is <B>fvwm</B>.</P>
<P>This window manager provides a great deal of control over the way you interact with X, especially because <B>fvwm</B> supports a host of configuration options. While you can run any window manager you want, <B>fvwm</B> seems to be the most popular in the Linux world. It’s not documented in many places or X books, so we’ll show you how to set up <B>fvwm</B> for your Linux system.</P>
<P>You can run only one window manager at a time.</P>
<H4 ALIGN="LEFT"><A NAME="Heading36"></A><FONT COLOR="#000077">Configuring Fvwm</FONT></H4>
<P>Most window managers under X support a configuration file. Usually, this file is located in a dot file in your home directory. Most window managers also follow a naming convention for their configuration file. For the <B>mwm</B> window manager, the file is named <B>.mwmrc</B>. For <B>twm</B>, it’s <B>.twmrc</B>. For <B>fvwm</B>, it’s <B>.fvwmrc</B>.</P>
<P>At startup, <B>fvwm</B> will look for your customizations in a file named <B>.fvwmrc</B> in your home directory. If you have no <B>.fvwmrc</B> file (which is likely when you start out), <B>fvwm</B> will look for a system file named <B>/usr/lib/X11/fvwm/system.fvwmrc</B>. If that file, too, is missing, <B>fvwm</B> will exit.</P>
<P>Because <B>fvwm</B> is a very complex window manager, you should copy the <B>system.fvwmrc</B> file or one of the example files to your home directory and name it <B>.fvwmrc</B>. By starting from a working example, you’ll find it a lot easier than creating a <B>.fvwmrc</B> file from scratch.</P>
<P>Once you find the <B>fvwm</B> system directory, you’ll see a number of sample configurations in the <B>sample_configs</B> directory. It’s easiest to configure <B>fvwm</B> from a working model, so you can either copy <B>system.fvwmrc</B> or one of the files in the <B>sample_configs</B> directory.</P>
<P>Once you have copied a working configuration file into your home directory, the next step is to start customizing. The <B>.fvwmrc</B> file is very long, so we’ll provide an overview of the areas you’re most likely to customize and then provide an example <B>.fvwmrc</B> file—a very long example—that you can use. Just browsing this example should give you plenty of ideas. In addition to our example, you may want to look at the <B>fvwm</B> example files mentioned earlier and look at <B>fvwm</B>’s online-manual page.</P>
<P>In the <B>.fvwmrc</B> file, the order of items is very important. It’s best to start with a working example and then search for the items we mention. Change the item’s value, but leave the item itself in the same relative position in the <B>.fvwmrc</B> file.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="161-164.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="168-172.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 + -