📄 0121-0123.html
字号:
<HTML>
<HEAD>
<TITLE>Sams Teach Yourself Linux in 24 Hours:Using the X Window System:EarthWeb Inc.-</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=0672311623 //-->
<!-- TITLE=Sams Teach Yourself Linux in 24 Hours//-->
<!-- AUTHOR=Bill Ball//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=07 //-->
<!-- PAGES=0103-0126 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0118-0120.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0124-0126.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-121"><P>Page 121</P></A>
<P>
followed by the word on. To set the time in seconds, use the
s option, followed by the number of seconds you want your X11 server to wait to blank the screen, for example:
</P>
<!-- CODE SNIP //-->
<PRE>
# xset s 60
</PRE>
<!-- END CODE SNIP //-->
<P>This will set the timeout interval to 60 seconds before the X11 screensaver is activated.
To test the screensaver, which is built into your X11 server, you can then use the
s option with the word activate, for example:
</P>
<!-- CODE SNIP //-->
<PRE>
# xset s on
# xset s activate
</PRE>
<!-- END CODE SNIP //-->
<P>This will display a blank screen. If you'd like to see a graphic and background pattern,
you can use the noblank option for xset's s command-line option, for example:
</P>
<!-- CODE SNIP //-->
<PRE>
# xset s noblank
# xset s activate
</PRE>
<!-- END CODE SNIP //-->
<P>As you can see, you'll find a large X displayed on the screen. To turn off screensaving,
use the s off command-line option. If this isn't your idea of a screensaver, you can try
the xscreensaver clients.
</P>
<P>The xscreensaver and xscreensaver-command clients, by Jamie Zawinski, are found under the
/usr/X11R6/bin directory. The xscreensaver client has 16 command-line options. Although this
hour doesn't cover all of the options, the basic way to use this screensaver is to first run
the xscreensaver client in the background as follows:
</P>
<!-- CODE SNIP //-->
<PRE>
# xscreensaver -timeout 5 &
</PRE>
<!-- END CODE SNIP //-->
<P>This command will set the screensaver to run after five minutes of no keyboard or
mouse activity. You can control this client with the
xscreensaver-command client, to turn the
xscreensaver on or off, or to activate it immediately. Although the
xscreensaver client has a -lock option to password-protect your display, you'll have to recompile the program to enable this feature.
</P>
<P>The xscreensaver client comes with nearly two dozen different screensavers, which can
also be run as standalone programs. For example, you can
run the fractal drawing program, hopalong, in a window with
</P>
<!-- CODE SNIP //-->
<PRE>
# hopalong
</PRE>
<!-- END CODE SNIP //-->
<P>This will run the screensaver in a window so you can see what it looks like. For a list
of the screensavers that will work with the
xscreensaver client, read the file XScreenSaver in the <BR>
/usr/X11R6/lib/X11/app-defaults directory. You'll find other settings in the file, which is the
X11 resources file for this client.
</P>
<P>You might also be interested in the xlock client. Although it is not a screensaver,
xlock is a sophisticated terminal-locking program with nearly 50 command-line options and
more
</P>
<A NAME="PAGENUM-122"><P>Page 122</P></A>
<P>
than 50 different displays built in. The xlock client is helpful if you want to
password-protect your display to prevent others from using your computer while you're away.
</P>
<P>By default, after you start the xlock program, you must enter your password before you
can use your display again. But you can use it as a simple screensaver without
password protection to display a variety of animations, for example:
</P>
<!-- CODE SNIP //-->
<PRE>
# xlock -duration 10 -nolock -mode random
</PRE>
<!-- END CODE SNIP //-->
<P>This command line tells the xlock program to display a random selection of its
animations, each of which will run for 10 seconds.
</P>
<TABLE BGCOLOR=#FFFF99>
<TR><TD>JUST A MINUTE</TD></TR>
<TR><TD>
<BLOCKQUOTE>
The xlock client can also make your desktop an animated display if you use the
-inroot command-line option. This won't protect your system, but you might
find the visuals stimulating!
</BLOCKQUOTE>
</TD></TR>
</TABLE>
<H3><A NAME="ch07_ 19">
Exploring X11 Programs
</A></H3>
<P>There's not enough room in this hour to discuss all of the X11 clients on your
CD-ROM. You will find discussions about different clients throughout the rest of this book, but
this section shows you some helpful programs that will give you more information about
your system, and some tips and tricks on how to use them.
</P>
<H4><A NAME="ch07_ 20">
Listing X11 Fonts with xlsfonts
</A></H4>
<P>If you'd like a list of all the fonts recognized by X11 on your system, you can
use the xlsfonts client. You'll want to use a pager like
less or more (discussed in Hour 4, "Reading
and Navigation Commands") if you call the client without any options. You can also
use wildcards or patterns to match font names. This can be handy to find a particular font
on your system, for example:
</P>
<!-- CODE //-->
<PRE>
# xlsfonts -fn *italic*
lucidasans-bolditalic-10
lucidasans-bolditalic-10
lucidasans-bolditalic-12
lucidasans-bolditalic-12
lucidasans-bolditalic-14
lucidasans-bolditalic-14
lucidasans-bolditalic-18
lucidasans-bolditalic-18
lucidasans-bolditalic-24
lucidasans-bolditalic-24
lucidasans-bolditalic-8
lucidasans-bolditalic-8
lucidasans-italic-10
</PRE>
<!-- END CODE //-->
<A NAME="PAGENUM-123"><P>Page 123</P></A>
<!-- CODE //-->
<PRE>
lucidasans-italic-10
lucidasans-italic-12
lucidasans-italic-12
lucidasans-italic-14
lucidasans-italic-14
lucidasans-italic-18
lucidasans-italic-18
lucidasans-italic-24
lucidasans-italic-24
lucidasans-italic-8
lucidasans-italic-8
</PRE>
<!-- END CODE //-->
<P>As you can see, this lists all the italic fonts installed or recognized by your X11 server.
You can use the xlsfonts client to troubleshoot whether or not fonts are recognized or
installed, or to find a font name to choose as a X Toolkit option when starting a client.
</P>
<H4><A NAME="ch07_ 21">
Getting Window Information with the xwininfo Client
</A></H4>
<P>You can use the xwininfo client, or window information utility, to get helpful
information about a window. When you use this command, you can click on a another window to
get a detailed information listing, for example:
</P>
<!-- CODE //-->
<PRE>
# xwininfo
xwininfo: Please select the window about which you
would like information by clicking the
mouse in that window.
</PRE>
<!-- END CODE //-->
<P>After you click the desired window, you'll see a list of information, such as the following:
</P>
<!-- CODE //-->
<PRE>
xwininfo: Window id: 0xc00002 "rxvt"
Absolute upper-left X: 8
Absolute upper-left Y: 397
Relative upper-left X: 0
Relative upper-left Y: 0
Width: 574
Height: 158
Depth: 8
Visual Class: PseudoColor
Border width: 0
Class: InputOutput
Colormap: 0x21 (installed)
Bit Gravity State: ForgetGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: no
Map State: IsViewable
Override Redirect State: no
Corners: +8+397 -218+397 -218-45 +8-45
-geometry 80x11+3-40
</PRE>
<!-- END CODE //-->
<P>This information can be helpful, for example, if you'd like to get the specifications
about a window's geometry settings for the next time you run the program, or if you'd like
to change the default behavior of a window by editing its resource file.
</P>
<P><CENTER>
<a href="0118-0120.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0124-0126.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -