📄 148-153.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=148-153//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="145-148.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="153-155.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading24"></A><FONT COLOR="#000077">Making the Most of X</FONT></H3>
<P>By now, you should have X up and running. Even so, with only a window manager and a few shell windows (<B>xterm</B>s), you haven’t seen much at all about what X can do for you and how to configure X more to your liking.</P>
<H4 ALIGN="LEFT"><A NAME="Heading25"></A><FONT COLOR="#000077">Setting Up Your X Account</FONT></H4>
<P>Depending on your preferences, there are different programs you may want to set up in your X environment. If you’re new to UNIX, you may want to run a file manager program such as <B>xfm</B>, as shown in Figure 3.5.</P>
<P><A NAME="Fig5"></A><A HREF="javascript:displayWindow('images/03-05.jpg',428,660 )"><IMG SRC="images/03-05t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/03-05.jpg',428,660)"><FONT COLOR="#000077"><B>Figure 3.5</B></FONT></A> The X file manager in action.</P>
<P>If you’re more familiar with UNIX, you’ll probably want to run a number of shell windows with the program called <B>xterm</B>. <B>xterm</B> presents a UNIX shell in a window but allows you to specify the number of lines, the fonts, and the colors used. You can also copy and paste between <B>xterm</B> windows, a handy feat with long, complicated UNIX command lines. (See the section on <B>xterm</B> later for more on this handy application.)</P>
<H4 ALIGN="LEFT"><A NAME="Heading26"></A><FONT COLOR="#000077">Configuring the Xterm Program</FONT></H4>
<P>The <B>xterm</B> program is probably the most popular X program. It seems kind of funny to run a shell window program, which is what <B>xterm</B> is, in a fancy graphical environment. But we’re still running X on top of Linux and we still need access to the UNIX environment.</P>
<P>Figure 3.6 shows <B>xterm</B>.</P>
<P><A NAME="Fig6"></A><A HREF="javascript:displayWindow('images/03-06.jpg',599,677 )"><IMG SRC="images/03-06t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/03-06.jpg',599,677)"><FONT COLOR="#000077"><B>Figure 3.6</B></FONT></A> The xterm program.</P>
<P>The neatest things about <B>xterm</B> are that you can:</P>
<DL>
<DD><B>•</B> Run multiple shell windows (<B>xterms</B>) at once.
<DD><B>•</B> Control the size of each <B>xterm</B> window.
<DD><B>•</B> Control the fonts and colors used by the <B>xterm</B> program.
<DD><B>•</B> Copy and paste between <B>xterm</B> windows and other X programs.
<DD><B>•</B> Use a scrollbar to view program output that has scrolled by.
</DL>
<P>Even though it’s called <B>xterm</B>, the program isn’t really a terminal emulator; it provides you with a UNIX shell window.</P>
<H4 ALIGN="LEFT"><A NAME="Heading27"></A><FONT COLOR="#000077">Controlling the Size of the Xterm Window</FONT></H4>
<P>The simplest way to control the size of an <B>xterm</B> window is through the <I>-geometry</I> command-line parameter:</P>
<!-- CODE SNIP //-->
<PRE>
gilbert:/$ xterm -geometry WidthxHeight &
</PRE>
<!-- END CODE SNIP //-->
<P>With this parameter, the <I>Width</I> is the number of characters wide, almost always 80, and the <I>Height</I> is the number of lines to use. We find that 40 is a good number (the default is 24 lines).</P>
<P>Just about every X program supports the <I>-geometry</I> command-line parameter, but virtually every X program treats the <I>-geometry</I> command-line parameter differently from <B>xterm</B> (<B>xterm</B> is the main exception, in other words). While you specify the width and height in terms of characters with <B>xterm</B>, just about every other X program treats the <I>-geometry</I> as the size in pixels. This is important to note if you create some really small windows.</P>
<P>For example, the command to start <B>xterm</B> with 80 columns (the default) and 40 lines is:</P>
<!-- CODE SNIP //-->
<PRE>
$ xterm -geometry 80x40 &
</PRE>
<!-- END CODE SNIP //-->
<P>With the <I>-geometry</I> command-line parameter you can also specify the starting location in pixels. The full syntax is:</P>
<!-- CODE SNIP //-->
<PRE>
-geometry WidthxHeight+X+Y
</PRE>
<!-- END CODE SNIP //-->
<P>In this case, <I>X</I> and <I>Y</I> specify the location of the upper-left corner of the program’s window in pixels. In X, the origin is also in the upper-left corner of the screen, so the following command creates an <B>xterm</B> window offset 10 pixels (in both <I>X</I> and <I>Y</I>) from the upper-left corner:</P>
<!-- CODE SNIP //-->
<PRE>
gilbert:/$ xterm -geometry 80x40+10+10 &
</PRE>
<!-- END CODE SNIP //-->
<P>You can skip the size (<I>width</I> and <I>height</I>) or the location (<I>x</I> and <I>y</I>). The following are all valid commands:</P>
<!-- CODE SNIP //-->
<PRE>
gilbert:/$ xterm -geometry 80x40 &
gilbert:/$ xterm -geometry +10+10 &
gilbert:/$ xterm &
</PRE>
<!-- END CODE SNIP //-->
<P><FONT SIZE="+1"><B>Setting Up a Scrollbar for Xterm</B></FONT></P>
<P>By default, <B>xterm</B> does not provide for a scrollbar, although one is available. You can use the <I>-sb</I> command-line parameter:</P>
<!-- CODE SNIP //-->
<PRE>
gilbert:/$ xterm -sb &
</PRE>
<!-- END CODE SNIP //-->
<P>This creates a scrollbar in the <B>xterm</B> window (usually on the left side).</P>
<P>The <B>xterm</B> scrollbar is kind of tricky. Use the middle mouse button to move to the position you want. The right mouse button (assuming you have a three-button mouse) moves back, while the left mouse button moves forward. We almost always just use the middle mouse button.</P>
<P>In addition to the <I>-sb</I> command-line parameter, you can request a scrollbar for <B>xterm</B> in an X resource file.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="145-148.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="153-155.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 + -