6d646453cc27a1bdb89f090f9158b9b14b60ff90
[xscreensaver] / driver / xscreensaver.man
1 .de EX          \"Begin example
2 .ne 5
3 .if n .sp 1
4 .if t .sp .5
5 .nf
6 .in +.5i
7 ..
8 .de EE
9 .fi
10 .in -.5i
11 .if n .sp 1
12 .if t .sp .5
13 ..
14 .TH XScreenSaver 1 "21-Jun-98 (2.23)" "X Version 11"
15 .SH NAME
16 xscreensaver - graphics hack and screen locker, launched when the user is idle
17 .SH SYNOPSIS
18 .B xscreensaver
19 [\-display \fIhost:display.screen\fP] \
20 [\-timeout \fIint\fP] \
21 [\-cycle \fIint\fP] \
22 [\-lock\-mode] \
23 [\-no\-lock\-mode] \
24 [\-lock\-timeout \fIint\fP] \
25 [\-visual \fIvisual\fP] \
26 [\-install] \
27 [\-no\-install] \
28 [\-verbose] \
29 [\-silent] \
30 [\-nice \fIint\fP] \
31 [\-mit\-extension] \
32 [\-no\-mit\-extension] \
33 [\-sgi\-extension] \
34 [\-no\-sgi\-extension] \
35 [\-xidle\-extension] \
36 [\-no\-xidle\-extension] \
37 [\-xrm \fIresources\fP]
38 .SH DESCRIPTION
39 The \fIxscreensaver\fP program waits until the keyboard and mouse have been 
40 idle for a period, and then runs a graphics demo chosen at random.  It 
41 turns off as soon as there is any mouse or keyboard activity.
42
43 This program can lock your terminal in order to prevent others from using it,
44 though its default mode of operation is merely to display pretty pictures on
45 your screen when it is not in use.  
46
47 The benefit that this program has over the combination of the
48 .BR xlock (1)
49 and
50 .BR xautolock (1)
51 programs is the ease with which new graphics hacks can be installed.  You
52 don't need to recompile (or even re-run) this program to add a new display
53 mode.
54 .SH GETTING STARTED
55 For the impatient, try this:
56 .EX
57 xscreensaver &
58 xscreensaver-command -demo
59 .EE
60 After a few seconds, the screen should go black, and a dialog box should
61 appear in the upper right corner.  This is \fIDemo Mode\fP.
62
63 .B Note:
64 unlike
65 .BR xlock (1),
66 xscreensaver has a client-server model: the xscreensaver process is a
67 daemon that runs in the background; it is controlled by the foreground
68 .BR xscreensaver-command (1)
69 program.
70 .SH DEMO MODE
71 If \fIxscreensaver\fP receives the \fBDEMO\fP ClientMessage, which is done
72 by running the
73 .BR xscreensaver\-command (1)
74 program with the \fB\-demo\fP option, the screensaver will black the screen
75 and pop up a dialog box from which you can examine and experiment with the
76 client programs.
77
78 The dialog box contains a scrolling list, a text field, and a number of 
79 buttons.  
80
81 Double-clicking on one of the programs in the list will run it.  The dialog
82 box will disappear, allowing the program access to the full screen.  Clicking
83 the mouse again will bring the dialog box back.
84
85 Single-clicking in the list will place the indicated program and its args
86 in the text field to be edited.  Edit the arguments and hit return to run
87 the program with the parameters you have specified.  (Note that these are
88 one-time changes and won't be remembered; to make the changes permanent,
89 you need to edit your X resource file.)
90
91 The buttons are:
92 .TP 8
93 .B Run Next
94 Clicking this button will run the next program in the list after the 
95 currently-selected one, and will scroll around to the top when it reaches
96 the bottom.
97 .TP 8
98 .B Run Previous
99 Opposite of Run Next; at the top, it scrolls around to the bottom.
100 .TP 8
101 .B Preferences
102 This pops up a second dialog box, in which you have the option to 
103 interactively change most of the screensaver's operational parameters,
104 such as its timeouts, and whether it should lock the screen.  Changing 
105 these parameters here will affect only the running \fIxscreensaver\fP
106 process; to make the changes permanent, you need to edit your X resource
107 file.  (See the \fIConfiguration\fP section, below.)
108 .TP 8
109 .B Exit Demo Mode
110 Returns to normal screensaver operation.
111 .TP 8
112 .B Reinitialize
113 This causes the X resource database to be re-read, to pick up any changes
114 you might have made.  This works by causing the screensaver process to exit
115 and then restart itself with the same command-line arguments.  This is just
116 like the \fI\-restart\fP argument to 
117 .BR xscreensaver\-command (1)
118 except that when executed from this button, the screensaver will 
119 automatically return to Demo Mode after restarting.
120 .SH CONFIGURATION
121 \fIxscreensaver\fP understands the following X resources.  The best way
122 to specify these parameters is to set them in your X resource file, 
123 which is usually called \fI~/.Xdefaults\fP.  For example, to set the
124 default value of the \fItimeout\fP resource, you would add the following
125 line to your .Xdefaults file:
126 .EX
127 xscreensaver.timeout: 5
128 .EE
129 To make the system notice this change, you might also need to run
130 .BR xrdb (1):
131 .EX
132 xrdb < ~/.Xdefaults
133 .EE
134 And if xscreensaver was already running, and you would like it to notice
135 your changes, you'll also have to tell the running xscreensaver process
136 to re-initialize itself, like so:
137 .EX
138 xscreensaver-command -restart
139 .EE
140 If you want to set the system-wide defaults, then make your edits to
141 the xscreensaver app-defaults file, which should have been installed
142 when xscreensaver itself was installed.  The app-defaults file will
143 usually be named /usr/lib/X11/app-defaults/XScreenSaver, but different
144 systems might keep it in a different place (for example,
145 /usr/openwin/lib/app-defaults/XScreenSaver on Solaris.)
146 .PP
147 .TP 8
148 .B timeout\fP (class \fBTime\fP)
149 The screensaver will activate (blank the screen) after the keyboard and
150 mouse have been idle for this many minutes.  Default 10 minutes.
151 .TP 8
152 .B cycle\fP (class \fBTime\fP)
153 After the screensaver has been running for this many minutes, the currently
154 running graphics-hack sub-process will be killed (with \fBSIGTERM\fP), and a
155 new one started.  If this is 0, then the graphics hack will never be changed:
156 only one demo will run until the screensaver is deactivated by user activity.
157 Default 10 minutes.
158 .TP 8
159 .B lock\fP (class \fBBoolean\fP)
160 Enable locking: before the screensaver will turn off, it will require you 
161 to type the password of the logged-in user (really, the person who ran
162 xscreensaver), or the root password.  (\fBNote:\fP this doesn't work if the
163 screensaver is launched by
164 .BR xdm (1)
165 because it can't know the user-id of the logged-in user.  See 
166 the ``\fIUsing XDM(1)\fP'' section, below.
167 .TP 8
168 .B lockTimeout\fP (class \fBTime\fP)
169 If locking is enabled, this controls the length of the ``grace period''
170 between when the screensaver activates, and when the screen becomes locked.
171 For example, if this is 5, and \fI\-timeout\fP is 10, then after 10 minutes,
172 the screen would blank.  If there was user activity at 12 minutes, no password
173 would be required to un-blank the screen.  But, if there was user activity
174 at 15 minutes or later (that is, \fI\-lock\-timeout\fP minutes after 
175 activation) then a password would be required.  The default is 0, meaning
176 that if locking is enabled, then a password will be required as soon as the 
177 screen blanks.
178 .TP 8
179 .B passwdTimeout\fP (class \fBTime\fP)
180 If the screen is locked, then this is how many seconds the password dialog box
181 should be left on the screen before giving up (default 30 seconds.)  This
182 should not be too large: the X server is grabbed for the duration that the
183 password dialog box is up (for security purposes) and leaving the server 
184 grabbed for too long can cause problems.
185 .TP 8
186 .B visualID\fP (class \fBVisualID\fP)
187 Specify which X visual to use by default.  (Note carefully that this resource
188 is called \fBvisualID\fP, not merely \fBvisual\fP; if you set the \fBvisual\fP
189 resource instead, things will malfunction in obscure ways for obscure reasons.)
190
191 Legal values for the \fBVisualID\fP resource are:
192 .RS 8
193 .TP 8
194 .B default
195 Use the screen's default visual (the visual of the root window.)  
196 This is the default.
197 .TP 8
198 .B best
199 Use the visual which supports the most colors.  Note, however, that the
200 visual with the most colors might be a TrueColor visual, which does not
201 support colormap animation.  Some programs have more interesting behavior
202 when run on PseudoColor visuals than on TrueColor.
203 .TP 8
204 .B mono
205 Use a monochrome visual, if there is one.
206 .TP 8
207 .B gray
208 Use a grayscale or staticgray visual, if there is one and it has more than
209 one plane (that is, it's not monochrome.)
210 .TP 8
211 .B color
212 Use the best of the color visuals, if there are any.
213 .TP 8
214 .I class
215 where \fIclass\fP is one of \fBStaticGray\fP, \fBStaticColor\fP, 
216 \fBTrueColor\fP, \fBGrayScale\fP, \fBPseudoColor\fP, or \fBDirectColor\fP.
217 Selects the deepest visual of the given class.
218 .TP 8
219 .I number
220 where \fInumber\fP (decimal or hex) is interpreted as a visual id number, 
221 as reported by the
222 .BR xdpyinfo (1)
223 program; in this way you can have finer control over exactly which visual
224 gets used, for example, to select a shallower one than would otherwise
225 have been chosen.
226
227 .RE
228 .RS 8
229 Note that this option specifies only the \fIdefault\fP visual that will
230 be used: the visual used may be overridden on a program-by-program basis.
231 See the description of the \fBprograms\fP resource, below.
232 .RE
233 .TP 8
234 .B installColormap\fP (class \fBBoolean\fP)
235 Install a private colormap while the screensaver is active, so that the
236 graphics hacks can get as many colors as possible.  This is the 
237 default.  (This only applies when the screen's default visual is being
238 used, since non-default visuals get their own colormaps automatically.)
239 This can also be overridden on a per-hack basis: see the discussion of
240 the \fBdefault\-n\fP name in the section about the \fBprograms\fP resource.
241 .TP 8
242 .B verbose\fP (class \fBBoolean\fP)
243 Whether to print diagnostics.  Default false.
244 .TP 8
245 .B nice\fP (class \fBNice\fP)
246 The sub-processes created by \fIxscreensaver\fP will be ``niced'' to this
247 level, so that they are given lower priority than other processes on the
248 system, and don't increase the load unnecessarily.  The default is 20.  
249
250 (Higher numbers mean lower priority; see 
251 .BR nice (1)
252 for details.)
253 .TP 8
254 .B sgiSaverExtension\fP (class \fBBoolean\fP)
255 There are a number of different X server extensions which can make
256 xscreensaver's job easier.  The next few resources specify whether these
257 extensions should be utilized if they are available.
258
259 This resource controls whether the SGI \fBSCREEN_SAVER\fP server extension
260 will be used to decide whether the user is idle.  This is the default 
261 if \fIxscreensaver\fP has been compiled with support for this 
262 extension (which is the default on SGI systems.).  If it is available, 
263 the \fBSCREEN_SAVER\fP method is faster and more reliable than what will
264 be done otherwise, so use it if you can.  (This extension is only available
265 on Silicon Graphics systems, unfortunately.)
266 .TP 8
267 .B mitSaverExtension\fP (class \fBBoolean\fP)
268 This resource controls whether the \fBMIT\-SCREEN\-SAVER\fP server extension
269 will be used to decide whether the user is idle.  However, the default for
270 this resource is \fIfalse\fP, because even if this extension is available,
271 it is flaky (and it also makes the \fBfade\fP option not work properly.)
272 Use of this extension is not recommended.
273 .TP 8
274 .B xidleExtension\fP (class \fBBoolean\fP)
275 This resource controls whether the \fBXIDLE\fP server extension will be
276 used to decide whether the user is idle.  This is the default 
277 if \fIxscreensaver\fP has been compiled with support for this extension.
278 (This extension is only available for X11R4 and X11R5 systems, unfortunately.)
279 .TP 8
280 .B fade\fP (class \fBBoolean\fP)
281 If this is true, then when the screensaver activates, the current contents
282 of the screen will fade to black instead of simply winking out.  This only
283 works on displays with writable colormaps, that is, if the screen's default
284 visual is a PseudoColor visual.  A fade will also be done when
285 switching graphics hacks (when the \fIcycle\fP timer expires.)
286 Default: true.  
287 .TP 8
288 .B unfade\fP (class \fBBoolean\fP)
289 If this is true, then when the screensaver deactivates, the original contents
290 of the screen will fade in from black instead of appearing immediately.  This
291 only works on displays with writable colormaps, and if \fIfade\fP is true
292 as well.  Default false.
293 .TP 8
294 .B fadeSeconds\fP (class \fBTime\fP)
295 If \fIfade\fP is true, this is how long the fade will be in 
296 seconds (default 3 seconds.)
297 .TP 8
298 .B fadeTicks\fP (class \fBInteger\fP)
299 If \fIfade\fP is true, this is how many times a second the colormap will
300 be changed to effect a fade.  Higher numbers yield smoother fades, but
301 may make the fades take longer than the specified \fIfadeSeconds\fP if
302 your server isn't fast enough to keep up.  Default 20.
303 .TP 8
304 .B captureStderr\fP (class \fBBoolean\fP)
305 Whether \fIxscreensaver\fP should redirect its standard-error stream to the
306 window itself.  Since its nature is to take over the screen, you would not
307 normally see error messages generated by xscreensaver or the sub-programs it
308 runs; this resource will cause the output of all relevant programs to be
309 drawn on the screensaver window itself, as well as being written to the
310 controlling terminal of the screensaver driver process.  Default true.
311 .TP 8
312 .B captureStdout\fP (class \fBBoolean\fP)
313 Like \fBcaptureStderr\fP but for the standard-output stream.  Default true.
314 .TP 8
315 .B font\fP (class \fBFont\fP)
316 The font used for the stdout/stderr text, if \fBcaptureStdout\fP or
317 \fBcaptureStderr\fP are true.  Default \fB*\-medium\-r\-*\-140\-*\-m\-*\fP
318 (a 14 point fixed-width font.)
319 .TP 8
320 .B overlayTextForeground\fP (class \fBForeground\fP)
321 The foreground color used for the stdout/stderr text, if \fBcaptureStdout\fP 
322 or \fBcaptureStderr\fP are true.  Default: Yellow.
323 .TP 8
324 .B overlayTextBackground\fP (class \fBBackground\fP)
325 The background color used for the stdout/stderr text, if \fBcaptureStdout\fP 
326 or \fBcaptureStderr\fP are true.  Default: Black.
327 .TP 8
328 .B programs\fP (class \fBPrograms\fP)
329 The graphics hacks which \fIxscreensaver\fP runs when the user is idle.
330 The value of this resource is a string, one \fIsh\fP-syntax command per line.  
331 Each line must contain exactly one command: no semicolons, no ampersands.
332
333 When the screensaver starts up, one of these is selected at random, and
334 run.  After the \fIcycle\fP period expires, it is killed, and another
335 is selected and run.
336
337 If the value of this resource is empty, then no programs will be run; the
338 screen will simply be made black.
339
340 If the display has multiple screens, then a different program will be run
341 for each screen.  (All screens are blanked and unblanked simultaniously.)
342
343 Note that you must escape the newlines; here is an example of how you
344 might set this in your \fI~/.Xdefaults\fP file:
345
346 .RS 8
347 .EX
348 xscreensaver.programs:  \\
349         qix -root                          \\n\\
350         ico -r -faces -sleep 1 -obj ico    \\n\\
351         xdaliclock -builtin2 -root         \\n\\
352         xv -root -rmode 5 image.gif -quit  \\n
353 .EE
354 .RE
355 .RS 8
356 Make sure your \fB$PATH\fP environment variable is set up correctly
357 \fIbefore\fP xscreensaver is launched, or it won't be able to find the
358 programs listed in the \fIprograms\fP resource.
359
360 To use a program as a screensaver, two things are required: that that
361 program draw on the root window (or be able to be configured to draw on
362 the root window); and that that program understand ``virtual root''
363 windows, as used by virtual window managers such as \fItvtwm\fP.  (Generally,
364 this is accomplished by just including the \fI"vroot.h"\fP header file in
365 the program's source.)
366
367 If there are some programs that you want to run only when using a color
368 display, and others that you want to run only when using a monochrome
369 display, you can specify that like this:
370
371 .EX
372     mono:   mono-program  -root        \\n\\
373     color:  color-program -root        \\n\\
374 .EE
375 .RE
376 .RS 8
377 More generally, you can specify the kind of visual that should be used for
378 the window on which the program will be drawing.  For example, if one 
379 program works best if it has a colormap, but another works best if it has
380 a 24-bit visual, both can be accommodated:
381
382 .EX
383     PseudoColor: cmap-program  -root   \\n\\
384     TrueColor:   24bit-program -root   \\n\\
385 .EE
386 .RE
387 .RS 8
388 (This sort of thing used to be accomplished with the \fIcolorPrograms\fP
389 and \fImonoPrograms\fP resources, but those resources have now been removed;
390 a warning will be issued if they are used.)
391
392 In addition to the symbolic visual names described above (in the discussion
393 of the \fIvisualID\fP resource) one other visual name is supported in
394 the \fIprograms\fP list:
395 .RS 1
396 .TP 4
397 .B default-n
398 This is like \fBdefault\fP, but also requests the use of the default colormap,
399 instead of a private colormap.  (That is, it behaves as if 
400 the \fI\-no\-install\fP command-line option was specified, but only for
401 this particular hack.)  This is provided because some third-party programs
402 that draw on the root window (notably: 
403 .BR xv (1),
404 and
405 .BR xearth (1))
406 make assumptions about the visual and colormap of the root window: 
407 assumptions which xscreensaver can violate.
408
409 .RE
410 If you specify a particular visual for a program, and that visual does not
411 exist on the screen, then that program will not be chosen to run.  This
412 means that on displays with multiple screens of different depths, you can
413 arrange for appropriate hacks to be run on each.  For example, if one screen
414 is color and the other is monochrome, hacks that look good in mono can be 
415 run on one, and hacks that only look good in color will show up on the other.
416 .RE
417 .PP
418 .PP
419 Normally you won't need to change the following resources:
420 .PP
421 .TP 8
422 .B bourneShell\fP (class \fBBourneShell\fP)
423 The pathname of the shell that \fIxscreensaver\fP uses to start subprocesses.
424 This must be whatever your local variant of \fB/bin/sh\fP is: in particular,
425 it must not be \fBcsh\fP.
426 .TP 8
427 .B windowCreationTimeout\fP (class \fBTime\fP)
428 When server extensions are not in use, this controls the delay between when 
429 windows are created and when \fIxscreensaver\fP selects events on them.
430 Default 30 seconds.
431 .TP 8
432 .B pointerPollTime\fP (class \fBTime\fP)
433 When server extensions are not in use, this controls how 
434 frequently \fIxscreensaver\fP checks to see if the mouse position or buttons
435 have changed.  Default 5 seconds.
436 .TP 8
437 .B initialDelay\fP (class \fBTime\fP)
438 When server extensions are not in use, \fIxscreensaver\fP will wait this many
439 seconds before selecting events on existing windows, under the assumption that 
440 \fIxscreensaver\fP is started during your login procedure, and the window 
441 state may be in flux.  Default 0.  (This used to default to 30, but that was
442 back in the days when slow machines and X terminals were more common...)
443 .TP 8
444 .B overlayStderr\fP (class \fBBoolean\fP)
445 If \fBcaptureStderr\fP or \fBcaptureStdout\fP are True, and your server 
446 supports ``overlay'' visuals, then the text will be written into one of
447 the higher layers instead of into the same layer as the running screenhack.
448 Set this to False to disable that (though you shouldn't need to.)
449 .SH COMMAND-LINE OPTIONS
450 .I xscreensaver
451 also accepts the following command line options.  Except for 
452 the \fI\-display\fP option, these command-line options are all 
453 simply shorthand for the X resources described in 
454 the \fIConfiguration\fP section, above.
455 .TP 8
456 .B \-display \fIhost:display.screen\fP
457 The X display to use.  For displays with multiple screens, XScreenSaver 
458 will manage all screens on the display simultaniously; the \fIscreen\fP 
459 argument (the ``default'' screen) says which screen should be used for
460 dialog boxes (the password window, \fIDemo Mode\fP, etc.)
461 .TP 8
462 .B \-timeout \fIminutes\fP
463 Same as the \fItimeout\fP resource.
464 .TP 8
465 .B \-cycle \fIminutes\fP
466 Same as the \fIcycle\fP resource.
467 .TP 8
468 .B \-lock\-mode
469 Same as setting the \fIlock\fP resource to \fItrue\fP.
470 .TP 8
471 .B \-no\-lock\-mode
472 Same as setting the \fIlock\fP resource to \fIfalse\fP.
473 .TP 8
474 .B \-lock\-timeout \fIminutes\fP
475 Same as the \fIlockTimeout\fP resource.
476 .TP 8
477 .B \-visual \fIvisual\fP
478 Same as the \fIvisualID\fP resource.
479 .TP 8
480 .B \-install
481 Same as setting the \fIinstallColormap\fP resource to \fItrue\fP.
482 .TP 8
483 .B \-no\-install
484 Same as setting the \fIinstallColormap\fP resource to \fIfalse\fP.
485 .TP 8
486 .B \-verbose
487 Same as setting the \fIverbose\fP resource to \fItrue\fP.
488 .TP 8
489 .B \-silent
490 Same as setting the \fIverbose\fP resource to \fIfalse\fP.
491 .TP 8
492 .B \-nice \fIinteger\fP
493 Same as the \fInice\fP resource.
494 .TP 8
495 .B \-sgi\-extension
496 Same as setting the \fIsgiSaverExtension\fP resource to \fItrue\fP.
497 .TP 8
498 .B \-no\-sgi\-extension
499 Same as setting the \fIsgiSaverExtension\fP resource to \fIfalse\fP.
500 .TP 8
501 .B \-mit\-extension
502 Same as setting the \fImitSaverExtension\fP resource to \fItrue\fP.
503 .TP 8
504 .B \-no\-mit\-extension
505 Same as setting the \fImitSaverExtension\fP resource to \fIfalse\fP.
506 .TP 8
507 .B \-xidle\-extension
508 Same as setting the \fIxidleExtension\fP resource to \fItrue\fP.
509 .TP 8
510 .B \-no\-xidle\-extension
511 Same as setting the \fIxidleExtension\fP resource to \fIfalse\fP.
512 .TP 8
513 .B \-xrm \fIresource-specification\fP
514 As with all other Xt programs, you can specify X resources on the command-line
515 using the \fI\-xrm\fP argument.  Most of the interesting resources have 
516 command-line equivalents, however.
517 .SH HOW IT WORKS
518 When it is time to activate the screensaver, a full-screen black window is
519 created on each screen of the display.  The window or windows is given the
520 appropriate properties so that, to any subsequently-created programs, it 
521 will appear to be a ``virtual root'' window.  Because of this, any program 
522 which draws on the root window (and which understands virtual roots) can be
523 used as a screensaver.
524
525 When the user becomes active again, the screensaver windows are unmapped and
526 the running subprocesses are killed by sending them \fBSIGTERM\fP.  This is 
527 also how the subprocesses are killed when the screensaver decides that it's
528 time to run a different demo: the old one is killed and a new one is launched.
529
530 Before launching a subprocess, \fIxscreensaver\fP stores an appropriate value
531 for \fB$DISPLAY\fP in the environment that the child will recieve.  (This is
532 so that if you start \fIxscreensaver\fP with a \fI-display\fP argument, the
533 programs which \fIxscreensaver\fP launches will draw on the same display;
534 and so that the child will end up drawing on the appropriate screen of a
535 multi-headed display.)
536
537 When the screensaver turns off, or is killed, care is taken to restore 
538 the ``real'' virtual root window if there is one.  Because of this, it is
539 important that you not kill the screensaver process with \fIkill -9\fP if
540 you are running a virtual-root window manager.  If you kill it with \-9,
541 you may need to restart your window manager to repair the damage.  This
542 isn't an issue if you aren't running a virtual-root window manager.
543
544 For all the gory details, see the commentary at the top of xscreensaver.c.
545
546 You can control a running screensaver process by using the
547 .BR xscreensaver\-command (1)
548 program (which see.)
549 .SH POWER MANAGEMENT
550 Modern X servers contain support to power down the monitor after an idle
551 period.  If the monitor has powered down, then \fIxscreensaver\fP will
552 notice this, and will not waste CPU by drawing graphics demos on a black
553 screen.  An attempt will also be made to explicitly power the monitor
554 back up as soon as user activity is detected.
555
556 If your X server supports power management, then
557 .BR xset (1)
558 will accept a \fBdpms\fP option.  So, if you wanted \fIxscreensaver\fP
559 to activate after 5 minutes, but you wanted your monitor to power down
560 after one hour (3600 seconds) you would do this:
561 .EX
562 xset dpms 3600
563 .EE
564 See the man page for the
565 .BR xset (1)
566 program for details.  (Note that power management requires both software
567 support in the X server, and hardware support in the monitor itself.)
568 .SH USING XDM(1)
569 You can run \fIxscreensaver\fP from your xdm session, so that the 
570 screensaver will run even when nobody is logged in on the console.  
571 Simply add \fB"xscreensaver &"\fP to your \fI/usr/lib/X11/xdm/Xsetup\fP 
572 file.  Because \fIxdm\fP grabs the keyboard, keypresses will not make 
573 the screensaver deactivate, but any mouse activity will.
574
575 Make sure you have \fB$PATH\fP set up correctly in the Xsetup script, or
576 \fIxdm\fP won't be able to find \fIxscreensaver\fP, and/or \fIxscreensaver\fP
577 won't be able to find its graphics hacks.
578
579 (If your system does not seem to be executing the \fIXsetup\fP file, you
580 may need to configure it to do so: the traditional way to do this is
581 to make that file the value of the \fIDisplayManager*setup\fP resource
582 in the \fI/usr/lib/X11/xdm/xdm-config\fP file.  See the man page for
583 .BR xdm (1)
584 for more details.)
585
586 Users may want to add \fB"xscreensaver-command -restart"\fP to their 
587 startup scripts, so that the screensaver will be reinitialized with
588 their private resource settings when they log in.  Users who don't do
589 this will get the system-wide defaults instead.
590
591 It is safe to run this program as root (as \fIxdm\fP is likely to do.)  If 
592 run as root, \fIxscreensaver\fP changes its effective user and group ids to
593 something safe (like \fI"nobody"\fP) before connecting to the X server
594 or launching user-specified programs.
595
596 Locking doesn't work if the screensaver is launched by \fIxdm\fP.  To get
597 around this, you can run the screensaver from \fIxdm\fP without locking, 
598 and kill and restart it from your personal X startup script to enable
599 locking; for example, by using this pair of commands:
600
601 .EX
602 xscreensaver-command -exit
603 xscreensaver
604 .EE
605 .SH USING CDE (COMMON DESKTOP ENVIRONMENT)
606 The easiest way to use \fIxscreensaver\fP on a system with CDE is to simply
607 switch off the built-in CDE screensaver, and use \fIxscreensaver\fP instead;
608 and second, to tell the front panel to run 
609 .BR xscreensaver\-command (1)
610 with the \fI\-lock\fP option when the \fILock\fP icon is clicked.
611
612 To accomplish this involves five steps:
613 .RS 4
614 .TP 3
615 \fB1: Switch off CDE's locker\fP
616 Do this by turning off ``\fIScreen Saver and Screen Lock\fP'' in the
617 Screen section of the Style Manager.
618 .TP 3
619 \fB2: Edit sessionetc\fP
620 Edit the file \fI~/.dt/sessions/sessionetc\fP and add to it the line
621
622 .EX
623 xscreensaver &
624 .EE
625 This will cause \fIxscreensaver\fP to be launched when you log in.
626 (As always, make sure that xscreensaver and the graphics demos are on
627 your \fB$PATH\fP; the path needs to be set in \fI.cshrc\fP 
628 and/or \fI.dtprofile\fP, not \fI.login\fP.)
629 .TP 3
630 \fB3: Create XScreenSaver.dt\fP
631 Create a file called \fI~/.dt/types/XScreenSaver.dt\fP with the following
632 contents:
633
634 .EX
635 ACTION XScreenSaver
636 {
637   LABEL         XScreenSaver
638   TYPE          COMMAND
639   EXEC_STRING   xscreensaver-command -lock
640   ICON          Dtkey
641   WINDOW_TYPE   NO_STDIO
642 }
643 .EE
644 This defines a ``lock'' command for the CDE front panel, that knows how
645 to talk to \fIxscreensaver\fP.
646 .TP 3
647 \fB4: Create Lock.fp\fP
648 Create a file called \fI~/.dt/types/Lock.fp\fP with the following
649 contents:
650
651 .EX
652 CONTROL Lock
653 {
654   TYPE             icon
655   CONTAINER_NAME   Switch
656   CONTAINER_TYPE   SWITCH
657   POSITION_HINTS   1
658   ICON             Fplock
659   LABEL            Lock
660   PUSH_ACTION      XScreenSaver
661   HELP_TOPIC       FPOnItemLock
662   HELP_VOLUME      FPanel
663 }
664 .EE
665 This associates the CDE front panel ``Lock'' icon with the lock command
666 we just defined in step 3.
667 .TP 3
668 \fB5: Restart\fP
669 Select ``\fIRestart Workspace Manager\fP'' from the popup menu to make
670 your changes take effect.  If things seem not to be working, check the
671 file \fI~/.dt/errorlog\fP for error messages.
672 .RE
673 .SH USING HP VUE (VISUAL USER ENVIRONMENT)
674 Since CDE is a descendant of VUE, the instructions for using xscreensaver
675 under VUE are similar to the above:
676
677 .RS 4
678 .TP 3
679 \fB1: Switch off VUE's locker\fP
680 Open the ``\fIStyle Manager\fP'' and select ``\fIScreen\fP.''
681 Turn off ``\fIScreen Saver and Screen Lock\fP'' option.
682 .TP 3
683 \fB2: Make sure you have a Session\fP
684 Next, go to the Style Manager's, ``\fIStartup\fP'' page.
685 Click on ``\fISet Home Session\fP'' to create a session, then 
686 on ``\fIReturn to Home Session\fP'' to select this session each
687 time you log in.
688 .TP 3
689 \fB3: Edit vue.session\fP
690 Edit the file \fI~/.vue/sessions/home/vue.session\fP and add to it
691 the line
692 .EX
693 vuesmcmd -screen 0 -cmd "xscreensaver"
694 .EE
695 This will cause \fIxscreensaver\fP to be launched when you log in.
696 (As always, make sure that xscreensaver and the graphics demos are on
697 your \fB$PATH\fP; the path needs to be set in \fI.cshrc\fP
698 and/or \fI.profile\fP, not \fI.login\fP.)
699 .TP 3
700 \fB3: Edit vuewmrc\fP
701 Edit the file \fI~/.vue/vuewmrc\fP and add (or change) the Lock control:
702 .EX
703 CONTROL Lock
704 {
705   TYPE         button
706   IMAGE        lock
707   PUSH_ACTION  f.exec "xscreensaver-command -lock"
708   HELP_TOPIC   FPLock
709 }
710 .EE
711 This associates the VUE front panel ``Lock'' icon with the xscreensaver 
712 lock command.
713 .RE
714 .PP
715 .SH ADDING TO MENUS
716 The
717 .BR xscreensaver-command (1)
718 program is a perfect candidate for something to add to your window manager's
719 popup menus.  If you use 
720 .BR mwm (1),
721 .BR 4Dwm (1),
722 .BR twm (1),
723 or (probably) any of \fItwm\fP's many descendants, you can do it like this:
724 .RS 0
725 .TP 3
726 \fB1. Create ~/.mwmrc (or ~/.twmrc or ...)\fP
727 If you don't have a \fI~/.mwmrc\fP file (or, on SGIs, a \fI~/.4Dwmrc\fP file;
728 or, with twm, a \fI~/.twmrc\fP file) then create one by making a copy of
729 the \fI/usr/lib/X11/system.mwmrc\fP 
730 file (or \fI/usr/lib/X11/twm/system.twmrc\fP, and so on.)
731 .TP 3
732 \fB2. Add a menu definition.\fP
733 Something like this:
734 .EX
735 menu XScreenSaver
736 {
737  "Blank Screen Now" !"sleep 3; xscreensaver-command -activate"
738  "Lock Screen Now"  !"sleep 3; xscreensaver-command -lock"
739  "Screen Saver Demo"         !"xscreensaver-command -demo"
740  "Reinitialize Screen Saver" !"xscreensaver-command -restart"
741  "Kill Screen Saver"         !"xscreensaver-command -exit"
742  "Launch Screen Saver"       !"xscreensaver &"
743 }
744 .EE
745 .TP 3
746 \fB3. Add the menu\fP
747 For
748 .BR mwm (1)
749 and
750 .BR 4Dwm (1),
751 find the section of the file that says \fIMenu DefaultRootMenu\fP.
752 For
753 .BR twm (1),
754 it will probably be \fImenu "defops"\fP.  If you add a line somewhere 
755 in that menu definition that reads
756 .EX
757   "XScreenSaver"        f.menu XScreenSaver
758 .EE
759 then this will add an XScreenSaver sub-menu to your default root-window
760 popup menu.  Alternately, you could just put the \fIxscreensaver-command\fP
761 menu items directly into the root menu.
762 .RE
763
764 Other window managers might (and probably do) do things differently.
765 .SH BUGS
766 (This is not a bug, but) note that as of release 1.32, the \fBcolorPrograms\fP 
767 and \fBmonoPrograms\fP resources are no longer used: they have been 
768 supplanted by the extended syntax of the \fBprograms\fP resource (which is
769 described in the \fIConfiguration\fP section, above.)
770 .TP 8
771 .B Extensions
772 If you are not making use of one of the server extensions (\fBXIDLE\fP,
773 \fBSGI SCREEN_SAVER\fP, or \fBMIT-SCREEN-SAVER\fP), then it is possible, in 
774 rare situations, for \fIxscreensaver\fP to interfere with event propagation 
775 and make another X program malfunction.  For this to occur, that other
776 application would need to \fInot\fP select \fBKeyPress\fP events on its 
777 non-leaf windows within the first 30 seconds of their existence, but then 
778 select for them later.  In this case, that client \fImight\fP fail to receive 
779 those events.  This isn't very likely, since programs generally select a
780 constant set of events immediately after creating their windows and then 
781 don't change them, but this is the reason that it's a good idea to install 
782 and use one of the server extensions instead, to work around this shortcoming
783 in the X protocol.
784 .TP 8
785 .B Machine Load
786 Although this program ``nices'' the subprocesses that it starts, 
787 graphics-intensive subprograms can still overload the machine by causing
788 the X server process itself (which is not ``niced'') to suck a lot of 
789 cycles.  Care should be taken to slow down programs intended for use as 
790 screensavers by inserting strategic calls to
791 .BR sleep (3)
792 or
793 .BR usleep (3)
794 (or making liberal use of any \fI\-delay\fP options which the programs 
795 may provide.)
796
797 Also, an active screensaver will cause your X server to be pretty much 
798 permanently swapped in; but the same is true of any program that draws
799 periodically, like 
800 .BR xclock (1)
801 or
802 .BR xload (1).
803 .TP 8
804 .B Latency and Responsiveness
805 If the subprocess is drawing too quickly and the connection to the X
806 server is a slow one (such as an X terminal running over a phone line) then 
807 the screensaver might not turn off right away when the user becomes active
808 again (the
809 .BR ico (1)
810 demo has this problem if being run in full-speed mode).  This can be
811 alleviated by inserting strategic calls to
812 .BR XSync (3)
813 in code intended for use as a screensaver.  This prevents too much graphics
814 activity from being buffered up.
815 .TP 8
816 .B Locking and XDM
817 If xscreensaver has been launched from XDM, you will need to cause the
818 xscreensaver daemon to exit and restart in order to lock the screen.
819
820 The reason for this is, if xscreensaver has been launched by XDM, that
821 means it was launched \fIbefore\fP you logged in: so it has no way of
822 knowing who the logged-in user is, and therefore, whose password it
823 should prompt for.
824
825 So if you want to use it as a locker, you must start it with your user id.
826 If it has already been started by \fIxdm\fP, you can kill it by sending
827 it the \fBexit\fP command, and then re-launching it as you, by putting
828 something like the following in your personal X startup script:
829 .EX
830 xscreensaver-command -exit
831 xscreensaver &
832 .EE
833 .TP 8
834 .B Locking and root logins
835 An implication of the above is that if you log in as \fIroot\fP on the
836 console, xscreensaver will refuse to lock the screen (because it can't tell
837 the difference between \fIroot\fP being logged in on the console, and a
838 normal user being logged in on the console but xscreensaver having been run
839 by
840 .BR xdm (1)).
841
842 The solution to this is simple: you shouldn't be logging in on the console
843 as \fIroot\fP in the first place!  (What, are you crazy or something?)  You 
844 should log in as you, and
845 .BR su (1)
846 to \fIroot\fP as necessary.  People who spend their day logged in 
847 as \fIroot\fP are just begging for disaster.
848 .TP 8
849 .B Passwords
850 If you get an error message like ``couldn't get password of \fIuser\fP'' 
851 then this probably means that you're on a system in which the
852 .BR getpwent (3)
853 library routine can only be effectively used by root.  If this is the case, 
854 then \fIxscreensaver\fP must be installed as setuid to root.  Care has 
855 been taken to make this a safe thing to do.  
856
857 It also may mean that your system uses shadow passwords instead of the
858 standard \fIgetpwent\fP interface; in that case, you may need to change
859 some options with \fIconfigure\fP and recompile.
860
861 If you change your password after xscreensaver has been launched, it will
862 continue using your old password to unlock the screen until xscreensaver
863 is restarted.  So, after you change your password, you'll have to do
864 .EX
865 xscreensaver-command -restart
866 .EE
867 to make \fIxscreensaver\fP notice.
868 .TP 8
869 .B Colormap lossage: TWM
870 The \fBinstallColormap\fP option doesn't work very well with the
871 .BR twm (1)
872 window manager and its descendants.  
873
874 There is a race condition between the screensaver and this window manager,
875 which can result in the screensaver's colormap not getting installed
876 properly, meaning the graphics hacks will appear in essentially random
877 colors.  (If the screen goes white instead of black, this is probably why.)
878
879 The
880 .BR mwm (1)
881 and
882 .BR olwm (1)
883 window managers don't seem to have this problem.  The race condition exists
884 because X does not provide a way for an OverrideRedirect window to have its
885 own colormap, short of grabbing the server (which is neither a good idea, nor
886 really possible with the current design.)  What happens is that, as soon as
887 the screensaver installs its colormap, \fBtwm\fP responds to 
888 the \fBColormapNotify\fP event that is generated by re-instaling the default
889 colormap.  Apparently, \fBtwm\fP doesn't \fIalways\fP do this; it seems to do
890 it regularly if the screensaver is activated from a menu item, but seems to
891 not do it if the screensaver comes on of its own volition, or is activated
892 from another console.  Any thoughts on this problem are welcome...
893 .TP 8
894 .B Colormap lossage: XV, XAnim, XEarth
895 Some programs don't operate properly on visuals other than the default one,
896 or with colormaps other than the default one.  See the discussion of the
897 magic "default-n" visual name in the description of the \fBprograms\fP 
898 resource in the \fIConfiguration\fP section.  When programs only work with
899 the default colormap, you need to use a syntax like this:
900 .EX
901     default-n: xv -root image-1.gif -quit  \\n\\
902     default-n: xearth -nostars -wait 0     \\n\\
903 .EE
904 It would also work to turn off the \fBinstallColormap\fP option altogether,
905 but that would deny extra colors to those programs that \fIcan\fP take
906 advantage of them.
907 .TP 8
908 .B XView Clients
909 Apparently there are some problems with XView programs getting confused
910 and thinking that the screensaver window is the real root window even when
911 the screensaver is not active: ClientMessages intended for the window manager
912 are sent to the screensaver window instead.  This could be solved by making
913 xscreensaver forward all unrecognised ClientMessages to the real root window,
914 but there may be other problems as well.  If anyone has any insight on the
915 cause of this problem, please let me know.  (XView is an X11 toolkit that 
916 implements the (quite abominable) Sun OpenLook look-and-feel.)
917 .TP 8
918 .B MIT Extension and Fading
919 When using the \fBMIT-SCREEN-SAVER\fP extension in conjunction with 
920 the \fBfade\fP option, you may notice an unattractive flicker just before 
921 the fade begins.  This is because the server maps a black window just before 
922 it tells the \fIxscreensaver\fP process to activate.  The \fIxscreensaver\fP 
923 process immediately unmaps that window, but this results in a flicker.  I 
924 haven't figured a way  to get around this; it seems to be a fundamental
925 property of the (mis-) design of this server extension.
926
927 It sure would be nice if someone would implement the \fBSGI SCREEN_SAVER\fP
928 extension in XFree86; it's dead simple, and works far better than the 
929 overengineered and broken \fBMIT-SCREEN-SAVER\fP extension.
930 .TP 8
931 .B Lesstif (Motif clone)
932 \fIDemo Mode\fP is buggy if XScreenSaver was compiled against really old 
933 versions Lesstif; if you use Lesstif, make sure you use version 0.82 or newer.
934 .TP 8
935 .B Athena Widgets
936 If you compiled against the Athena widget toolkit, the dialog boxes are
937 pretty ugly, especially the password dialog.  Use Motif!  If you don't
938 have OSF Motif, use GNU Lesstif, it's free: http://www.lesstif.org/
939 .TP 8
940 .B SGI Power Saver
941 If you're running Irix 6.3, you might find that your monitor is powering down
942 after an hour or two even if you've told it not to.  This is fixed by SGI
943 patches 2447 and 2537.
944 .TP 8
945 .B OpenGL Programs and Visuals
946 Some of the graphics demos included with xscreensaver make use of the 
947 OpenGL (or MesaGL) 3D library, if it is available.  It is possible (even 
948 likely) that \fIxscreensaver\fP's notion of the ``\fIbest\fP'' visual is 
949 not quite right for these GL programs.  
950
951 The odd thing about GL programs is that, unlike normal X11 programs, they
952 tend to work best on a visual \fIhalf\fP as deep as the depth of the screen,
953 since that way, they can do double-buffering.  Try it and see, but you will
954 probably find that, for these particular programs, you should specify the
955 deepest visual that is half as deep as the screen.  (See the discussion
956 of the \fBprograms\fP resource in the \fIConfiguration\fP section, above.)
957
958 For example, on a screen that supports both 24-bit TrueColor and 12-bit
959 PseudoColor visuals, the 12-bit visual will probably work best (this is true
960 of base-model SGI Indys: the 0x29 visual is the one you want.)  Oddly, on 
961 SGI O2s (machines that have serious hardware support for GL), the 12-bit
962 PseudoColor visual looks awful (you get a black and white, flickery image.)
963 On these machines, the visual you want turns out to be 0x31.  However, 0x31
964 is but \fIone\fP of the \fIeight\fP 15-bit TrueColor visuals (yes, 8, and 
965 yes, 15) that the O2 X server provides.  This is the only visual that works
966 properly: as far as 
967 .BR xdpyinfo (1)
968 is concerned, all of the 15-bit TrueColor visuals are identical, but some
969 flicker like mad, and some have deeply weird artifacts (such as hidden 
970 surfaces that show through, as if depth worked backwards!)  
971
972 I suppose these other visuals must be tied to some arcane hardware feature...
973 If anyone would care to explain it to me, that would be great.
974
975 Your mileage, therefore, may vary dramatically.
976 .TP 8
977 .B Red Hot Lava
978 There need to be a lot more graphics hacks.  In particular, there should be
979 a simulation of a Lavalite (tm).
980 .SH ENVIRONMENT
981 .PP
982 .TP 8
983 .B DISPLAY
984 to get the default host and display number, and to inform the sub-programs
985 of the screen on which to draw.
986 .TP 8
987 .B PATH
988 to find the sub-programs to run.
989 .TP 8
990 .B XENVIRONMENT
991 to get the name of a resource file that overrides the global resources
992 stored in the RESOURCE_MANAGER property.
993 .SH UPGRADES
994 The latest version can always be found at 
995 http://people.netscape.com/jwz/xscreensaver/
996 .SH SEE ALSO
997 .BR X (1),
998 .BR xscreensaver\-command (1),
999 .BR xdm (1),
1000 .BR xset (1),
1001 .BR ant (1),
1002 .BR atlantis (1),
1003 .BR attraction (1),
1004 .BR blitspin (1),
1005 .BR bouboule (1),
1006 .BR braid (1),
1007 .BR bsod (1),
1008 .BR bubbles (1),
1009 .BR cage (1),
1010 .BR coral (1),
1011 .BR cynosure (1),
1012 .BR decayscreen (1),
1013 .BR deco (1),
1014 .BR drift (1),
1015 .BR epicycle (1),
1016 .BR fadeplot (1),
1017 .BR flag (1),
1018 .BR flame (1),
1019 .BR forest (1),
1020 .BR galaxy (1),
1021 .BR gears (1),
1022 .BR goop (1),
1023 .BR grav (1),
1024 .BR greynetic (1),
1025 .BR halo (1),
1026 .BR helix (1),
1027 .BR hopalong (1),
1028 .BR hypercube (1),
1029 .BR ifs (1),
1030 .BR imsmap (1),
1031 .BR interference (1),
1032 .BR jigsaw (1),
1033 .BR julia (1),
1034 .BR kaleidescope (1),
1035 .BR laser (1),
1036 .BR lightning (1),
1037 .BR lisa (1),
1038 .BR lissie (1),
1039 .BR lmorph (1),
1040 .BR maze (1),
1041 .BR moebius (1),
1042 .BR moire (1),
1043 .BR moire2 (1),
1044 .BR morph3d (1),
1045 .BR mountain (1),
1046 .BR munch (1),
1047 .BR noseguy (1),
1048 .BR pedal (1),
1049 .BR penrose (1),
1050 .BR pipes (1),
1051 .BR pyro (1),
1052 .BR qix (1),
1053 .BR rd-bomb (1),
1054 .BR rocks (1),
1055 .BR rorschach (1),
1056 .BR rotor (1),
1057 .BR rubik (1),
1058 .BR sierpinski (1),
1059 .BR slidescreen (1),
1060 .BR slip (1),
1061 .BR sphere (1),
1062 .BR spiral (1),
1063 .BR sproingies (1),
1064 .BR stairs (1),
1065 .BR starfish (1),
1066 .BR strange (1),
1067 .BR superquadrics (1),
1068 .BR swirl (1),
1069 .BR triangle (1),
1070 .BR truchet (1),
1071 .BR vines (1),
1072 .BR worm (1),
1073 .BR xjack (1),
1074 .BR xlyap (1),
1075 .BR xroger (1),
1076 .BR bongo (1),
1077 .BR ico (1),
1078 .BR xaos (1),
1079 .BR xbouncebits (1),
1080 .BR xcthugha (1),
1081 .BR xdaliclock (1),
1082 .BR xfishtank (1),
1083 .BR xmountains (1),
1084 .BR xsplinefun (1),
1085 .BR xswarm (1),
1086 .BR xtacy (1),
1087 .BR xv (1),
1088 .BR xwave (1).
1089 .SH COPYRIGHT
1090 Copyright \(co 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
1091 by Jamie Zawinski.  Permission to use, copy, modify, distribute, and sell
1092 this software and its documentation for any purpose is hereby granted without
1093 fee, provided that the above copyright notice appear in all copies and that
1094 both that copyright notice and this permission notice appear in supporting
1095 documentation.  No representations are made about the suitability of this
1096 software for any purpose.  It is provided "as is" without express or implied
1097 warranty.
1098 .SH AUTHOR
1099 Jamie Zawinski <jwz@netscape.com>.  Written in late 1991; first posted
1100 to comp.sources.x on 13-Aug-1992.
1101
1102 Please let me know if you find any bugs or make any improvements.
1103 .SH ACKNOWLEDGEMENTS
1104 Thanks to David Wojtowicz for implementing \fIlockTimeout\fP.
1105
1106 Thanks to Martin Kraemer for adding support for shadow passwords and
1107 locking-disabled diagnostics.
1108
1109 Thanks to the many people who have contributed graphics demos to the package.
1110
1111 Thanks to Patrick Moreau for the VMS port.
1112
1113 Thanks to Mark Bowyer for figuring out how to hook it up to CDE.
1114
1115 And huge thanks to Jon A. Christopher for implementing the Athena dialog
1116 support, back in the days before Lesstif was a viable alternative to Motif.