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

📄 linux-x-screensaver.html

📁 Linus guide, Linus guide, Linus guide,
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><html><head><title>Setting Up Xscreensaver</title>   <META NAME="Description" CONTENT="A tutorial on setting up Xscreensaver which assumes very little prior Linux/X knowledge.">   <META NAME="Keywords" CONTENT="Xscreensaver, Linux, X, screensaver, how to, setup"><BASE TARGET="_top"></head><BODY BGCOLOR="#FFFFFF" TEXT="#000000"><h2>Setting Up Xscreensaver</h2><FONT SIZE="-1"><B>Created: July 8, 1998</B></FONT><BR><FONT SIZE="-1"><B>Last updated: July 9, 1998</B></FONT><BR><FONT SIZE="-1"><B>Development stage: Beta</B></FONT><p>This little tutorial is intended to help a Linux newbie to dosomething fun and hopefully learn some useful Linux commands and concepts along the way. Those more experienced with Linux may find the amount of hand-holding here to be irritating. Well, let me say right off the bat that there's nothing here you couldn't find out from the xscreensaver man page, but for the novice user, this tutorial should be a little easier to follow.<p>First of all, you should be running X now.<p>Now check to see if the screensaver is already running. Some Linuxdistributions may have already put it in one of the files that starts up client applications for X. (These are /etc/xinit/xinitrc, /etc/xinit/Xclients, ~/.xinitrc, and ~/.Xclients.)  To see if xscreensaver is already running, do <kbd>ps af</kbd> and look at the result. (<strong>ps</strong> is a commandthat lists the running processes on the system... very handy.)<p>For instance, part of the output of <kbd>ps af</kbd> looks like this for me:<code><pre>  PID TTY STAT  TIME COMMAND    ...  252   1 S    0:00 /bin/login -- pw   260   1 S    0:00  \_ -bash   271   1 S    0:00      \_ sh /usr/X11R6/bin/startx   272   1 S    0:00          \_ xinit /usr/X11R6/lib/X11/xinit/xinitrc --   276   1 S    0:01              \_ wmaker   280   1 S    0:00                  \_ xscreensaver   281   1 S    0:00                  \_ nxterm   286  p0 S    0:00                  |   \_ bash   293  p0 R    0:00                  |       \_ ps af   284   1 S    0:00                  \_ asclock -shape </pre></code><p>Every process is listed with a <b>P</b>rocess <b>ID</b> number. Lookat PID 280 ... there you see that xscreensaver is running on mysystem.<p>If you don't see xscreensaver listed, it's not running. To start itup, type this in an xterm: <kbd>xscreensaver &</kbd>. If you get an error message, you may not have xscreensaver installedon your system.  Try <kbd>locate xscreensaver</kbd> or <kbd>find /-name "*xscreensaver*"</kbd> and see if that turns anything up. Ifnot, you need to get it... it may be on your distribution CD-ROMs (itcomes with RedHat, for example), or look at the <a href="http://people.netscape.com/jwz/xscreensaver/index.html">Xscreensaver home page.</a><h3>Choosing Screensaver Graphics</h3><p>Anyway, now you've got xscreensaver running, but it probably isn'tdoing anything yet. The next thing you want to do is type<kbd>xscreensaver-command -demo</kbd> . This puts xscreensaver into aninteractive demo mode, so you can see which screensavers you like.<p>Also at this time, you should use your favorite text editor to openthe .Xdefaults file in your home directory. If you don't have one yet, goahead and create the file. .Xdefaults is a file that contains defaultoptions for many programs that run in X. Nearly any X application willhave a man page or other documentation that describes its "Xresources"... that is, the options that can be set in a user's.Xdefaults file. What we're going to do now is add some entriesto .Xdefaults that tells xscreensaver which graphics program(s) to run.<p>The xscreensaver demo is pretty easy to figure out. It blackens thescreen and pops up a little window where you can select which graphicsprogram (which are generally referred to as "hacks") to run. When you select one, it starts running and the windowgets hidden. To bring back the demo dialog window, just right-clickthe mouse. You can scroll through the list, jump to the next orprevious graphics hack, etc. When you find a graphics hack you like,add it to your .Xdefaults file. Here's what you want to put in:<code><pre>xscreensaver.programs:  \                        rocks -root     \n\			hopalong -root \n\                        flame -root \n</pre></code>This is just an example; I like these three graphics hacks. The backslashes are necessary so that all of this is read as one line. Each graphics hack listed must have the <code>-root</code> flag, to tell it to draw on the "root" window (i.e. the whole screen), and each hack entry must end with \n\, except the last one which must end with \n ... it looks weird to the uninitiated, but that's just how it works.<p>Do <kbd>xscreensaver-command -demo</kbd>again, and try all the graphics hacks, adding each one you really like toyour .Xdefaults file. When you're done, save .Xdefaults, and click the"Reinitialize" button in the xscreensaver demo. Now only the hackslisted in your .Xdefaults are listed by the demo, and only these willbe run when the screensaver starts.<h3>Getting the Screensaver to Start</h3>If you want the screensaver ready to go all the time when you're in X, putthis in your .Xclients file:<p><code>xscreensaver &</code> <p>As with anything you put in .xinitrc or .Xclients, the command shouldn't be the last thing in the file. Usually your window manager is the last thing started. (On RedHat systems, /etc/xinit/xinitrc does some auto-detect things and starts the window manager; probably everything you personally want to start should go in ~/.Xclients.) The command you add must end with an ampersand to put that process in thebackground; otherwise, X will exit if the process is killed, and you don't want that behavior from anything but the window manager.<p>You can manually start the screensaver at any time by typing<kbd>xscreensaver &</kbd>, and then if you want to test it out quickly, you can make it immediately take over thescreen by typing <kbd>xscreensaver-command -active</kbd>. If the screensaver is already running and you want it to load some new resources you've just added to ~/.Xdefaults, simply type <kbd>xscreensaver-command -reset</kbd>.<h3>Controlling Xscreensaver's Behavior</h3>By default, xscreensaver will start if the user is inactive for tenminutes. At that time it will randomly pick one of the graphics hacksin your .Xdefaults file. Ten minutes later it will randomly selectanother one. You can change all of this in your .Xdefaults file.<p>For instance, if I put this in my .Xdefaults:<code><pre>xscreensaver.timeout: 2xscreensaver.cycle: 1</pre></code>...Xscreensaver will now start after 2 minutes of inactivity, and willswitch to another graphics hack every 1 minute after that. If<kbd>xscreensaver.cycle</kbd> is set to 0, then no cycling will take place. All of these options can also be set by the command line that starts xscreensaver. There's many other options. <kbd>manxscreensaver</kbd> for details.<h3>Tweaking the Screensaver Graphics</h3>We haven't mentioned this yet, but the graphics hacks that thescreensaver runs are actually completely separate X programs, and they all havecommand-line options that change the way they look and behave. Forinstance, run <kbd>flame</kbd>. With no arguments, a new window iscreated and the "Flame" graphics hack runs in it. If you instead type<kbd>flame -help</kbd>, you'll get a listing of the options flame cantake. These are described in the flame man page (yes, <kbd>manflame</kbd>). For instance, if we do <kbd>flame -delay 100 -delay210000</kbd>, it runs a lot faster.<p>You can play around with command-line options for all your favoritegraphics hacks, and when you've got one you like, put the same commandline flags into the appropriate entry in your .Xdefaults file. Forinstance, I've got this line:<code><pre>                   kaleidescope -root -nsegments 5 -ntrails 50 \n\</pre></code>...which looks a bit different than the default kaleidescope.<h3>Locking the Screensaver</h3>You can easily set up xscreensaver to "lock" ... that is, it won't letyou back in to your system without your password. This could be usefulif you have stuff on your system you want to keep private from anyonewho might wander by, like at work or something I guess.  In the demo,you can turn it on by clicking "Edit Parameters" and then "RequirePassword." Then type <kbd>xscreensaver-command -activate</kbd> to turnthe screensaver on, and you'll notice that it asks for your passwordwhen you try to do anything.<p>If you like this feature, put this line in your .Xdefaults file:<p><kbd>xscreensaver.lock: True</kbd><h3>One More Cool Trick</h3>This one is guaranteed to SURPRISE and AMUSE YOUR FRIENDS!<sup>TM</sup><p>This isn't really part of xscreensaver, but it's fun anyway. You can run any of the graphics hacks on your root window all thetime, and it will just stay there merrily animating away behind allthe stuff you work on. For instance, put this line in your .Xclientsor .xinitrc if you really like to get dizzy and distracted while you work:<p><code>kaleidescope -root -nsegments 5 -ntrails 50 &</code><p>Of course, you can use any of the hacks you like instead of kaleidescope. You could even pick one that doesn't give you motion-sickness, but where's the fun in that?<p>That's all!<hr>Send comments and corrections to <a href="mailto:zarmzarm@hotmail.com">Paul Winkler.</a><a href="mailto:abuse@hotmail.com"> </a><a href="abuse@localhost"> </a> <a href="postmaster@localhost"> </a><hr><B><FONT SIZE="-1">&copy; 1998 Paul M. Winkler.  All rights reserved. Permission is hereby granted to use, distribute, and copy this document for non-profit purposes only. You may modify this document as long as credit to me is given. Any unauthorized commercial useage of this document is expressly forbidden. Just ask nicely.</FONT></B></html>______________________________________________________Get Your Private, Free Email at http://www.hotmail.com

⌨️ 快捷键说明

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