ce5756bb6b5b8c59a7e0917994d95430e8aec24a
[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 "15-Jun-98 (2.21)" "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 USING XDM(1)
550 You can run \fIxscreensaver\fP from your xdm session, so that the 
551 screensaver will run even when nobody is logged in on the console.  
552 Simply add \fB"xscreensaver &"\fP to your \fI/usr/lib/X11/xdm/Xsetup\fP 
553 file.  Because \fIxdm\fP grabs the keyboard, keypresses will not make 
554 the screensaver deactivate, but any mouse activity will.
555
556 Make sure you have \fB$PATH\fP set up correctly in the Xsetup script, or
557 \fIxdm\fP won't be able to find \fIxscreensaver\fP, and/or \fIxscreensaver\fP
558 won't be able to find its graphics hacks.
559
560 (If your system does not seem to be executing the \fIXsetup\fP file, you
561 may need to configure it to do so: the traditional way to do this is
562 to make that file the value of the \fIDisplayManager*setup\fP resource
563 in the \fI/usr/lib/X11/xdm/xdm-config\fP file.  See the man page for
564 .BR xdm (1)
565 for more details.)
566
567 Users may want to add \fB"xscreensaver-command -restart"\fP to their 
568 startup scripts, so that the screensaver will be reinitialized with
569 their private resource settings when they log in.  Users who don't do
570 this will get the system-wide defaults instead.
571
572 It is safe to run this program as root (as \fIxdm\fP is likely to do.)  If 
573 run as root, \fIxscreensaver\fP changes its effective user and group ids to
574 something safe (like \fI"nobody"\fP) before connecting to the X server
575 or launching user-specified programs.
576
577 Locking doesn't work if the screensaver is launched by \fIxdm\fP.  To get
578 around this, you can run the screensaver from \fIxdm\fP without locking, 
579 and kill and restart it from your personal X startup script to enable
580 locking; for example, by using this pair of commands:
581
582 .EX
583 xscreensaver-command -exit
584 xscreensaver
585 .EE
586 .SH USING CDE (COMMON DESKTOP ENVIRONMENT)
587 The easiest way to use \fIxscreensaver\fP on a system with CDE is to simply
588 switch off the built-in CDE screensaver, and use \fIxscreensaver\fP instead;
589 and second, to tell the front panel to run 
590 .BR xscreensaver\-command (1)
591 with the \fI\-lock\fP option when the \fILock\fP icon is clicked.
592
593 To accomplish this involves five steps:
594 .RS 4
595 .TP 3
596 \fB1: Switch off CDE's locker\fP
597 Do this by turning off ``\fIScreen Saver and Screen Lock\fP'' in the
598 Screen section of the Style Manager.
599 .TP 3
600 \fB2: Edit sessionetc\fP
601 Edit the file \fI~/.dt/sessions/sessionetc\fP and add to it the line
602
603 .EX
604 xscreensaver &
605 .EE
606 This will cause \fIxscreensaver\fP to be launched when you log in.
607 (As always, make sure that xscreensaver and the graphics demos are on
608 your \fB$PATH\fP; the path needs to be set in \fI.cshrc\fP 
609 and/or \fI.dtprofile\fP, not \fI.login\fP.)
610 .TP 3
611 \fB3: Create XScreenSaver.dt\fP
612 Create a file called \fI~/.dt/types/XScreenSaver.dt\fP with the following
613 contents:
614
615 .EX
616 ACTION XScreenSaver
617 {
618   LABEL         XScreenSaver
619   TYPE          COMMAND
620   EXEC_STRING   xscreensaver-command -lock
621   ICON          Dtkey
622   WINDOW_TYPE   NO_STDIO
623 }
624 .EE
625 This defines a ``lock'' command for the CDE front panel, that knows how
626 to talk to \fIxscreensaver\fP.
627 .TP 3
628 \fB4: Create Lock.fp\fP
629 Create a file called \fI~/.dt/types/Lock.fp\fP with the following
630 contents:
631
632 .EX
633 CONTROL Lock
634 {
635   TYPE             icon
636   CONTAINER_NAME   Switch
637   CONTAINER_TYPE   SWITCH
638   POSITION_HINTS   1
639   ICON             Fplock
640   LABEL            Lock
641   PUSH_ACTION      XScreenSaver
642   HELP_TOPIC       FPOnItemLock
643   HELP_VOLUME      FPanel
644 }
645 .EE
646 This associates the CDE front panel ``Lock'' icon with the lock command
647 we just defined in step 3.
648 .TP 3
649 \fB5: Restart\fP
650 Select ``\fIRestart Workspace Manager\fP'' from the popup menu to make
651 your changes take effect.  If things seem not to be working, check the
652 file \fI~/.dt/errorlog\fP for error messages.
653 .RE
654 .SH USING HP VUE (VISUAL USER ENVIRONMENT)
655 Since CDE is a descendant of VUE, the instructions for using xscreensaver
656 under VUE are similar to the above:
657
658 .RS 4
659 .TP 3
660 \fB1: Switch off VUE's locker\fP
661 Do this by turning off ``\fIScreen Saver and Screen Lock\fP'' in the
662 Screen section of the Style Manager.
663 .TP 3
664 \fB2: Edit vue.session\fP
665 Edit the file \fI~/.vue/sessions/home/vue.session\fP and add to it
666 the line
667 .EX
668 vuesmcmd -screen 0 -cmd "xscreensaver"
669 .EE
670 This will cause \fIxscreensaver\fP to be launched when you log in.
671 (As always, make sure that xscreensaver and the graphics demos are on
672 your \fB$PATH\fP; the path needs to be set in \fI.cshrc\fP
673 and/or \fI.profile\fP, not \fI.login\fP.)
674 .TP 3
675 \fB3: Edit vuewmrc\fP
676 Edit the file \fI~/.vue/vuewmrc\fP and add (or change) the Lock control:
677 .EX
678 CONTROL Lock
679 {
680   TYPE         button
681   IMAGE        lock
682   PUSH_ACTION  f.exec "xscreensaver-command -lock"
683   HELP_TOPIC   FPLock
684 }
685 .EE
686 This associates the VUE front panel ``Lock'' icon with the xscreensaver 
687 lock command.
688 .RE
689 .PP
690 .SH ADDING TO MENUS
691 The
692 .BR xscreensaver-command (1)
693 program is a perfect candidate for something to add to your window manager's
694 popup menus.  If you use 
695 .BR mwm (1),
696 .BR 4Dwm (1),
697 .BR twm (1),
698 or (probably) any of \fItwm\fP's many descendants, you can do it like this:
699 .RS 0
700 .TP 3
701 \fB1. Create ~/.mwmrc (or ~/.twmrc or ...)\fP
702 If you don't have a \fI~/.mwmrc\fP file (or, on SGIs, a \fI~/.4Dwmrc\fP file;
703 or, with TWM, a \fI~/.twmrc\fP file) then create one by making a copy of
704 the \fI/usr/lib/X11/system.mwmrc\fP 
705 file (or \fI/usr/lib/X11/twm/system.twmrc\fP, and so on.)
706 .TP 3
707 \fB2. Add a menu definition.\fP
708 Something like this:
709 .EX
710 menu XScreenSaver
711 {
712  "Blank Screen Now" !"sleep 3; xscreensaver-command -activate"
713  "Lock Screen Now"  !"sleep 3; xscreensaver-command -lock"
714  "Screen Saver Demo"         !"xscreensaver-command -demo"
715  "Reinitialize Screen Saver" !"xscreensaver-command -restart"
716  "Kill Screen Saver"         !"xscreensaver-command -exit"
717  "Launch Screen Saver"       !"xscreensaver &"
718 }
719 .EE
720 .TP 3
721 \fB3. Add the menu\fP
722 For
723 .BR mwm (1)
724 and
725 .BR 4Dwm (1),
726 find the section of the file that says \fIMenu DefaultRootMenu\fP.
727 For
728 .BR twm (1),
729 it will probably be \fImenu "defops"\fP.  If you add a line somewhere 
730 in that menu definition that reads
731 .EX
732   "XScreenSaver"        f.menu XScreenSaver
733 .EE
734 then this will add an XScreenSaver sub-menu to your default root-window
735 popup menu.  Alternately, you could just put the \fIxscreensaver-command\fP
736 menu items directly into the root menu.
737 .RE
738
739 Other window managers might (and probably do) do things differently.
740 .SH BUGS
741 (This is not a bug, but) note that as of release 1.32, the \fBcolorPrograms\fP 
742 and \fBmonoPrograms\fP resources are no longer used: they have been 
743 supplanted by the extended syntax of the \fBprograms\fP resource (which is
744 described in the \fIConfiguration\fP section, above.)
745 .TP 8
746 .B Extensions
747 If you are not making use of one of the server extensions (\fBXIDLE\fP,
748 \fBSGI SCREEN_SAVER\fP, or \fBMIT-SCREEN-SAVER\fP), then it is possible, in 
749 rare situations, for \fIxscreensaver\fP to interfere with event propagation 
750 and make another X program malfunction.  For this to occur, that other
751 application would need to \fInot\fP select \fBKeyPress\fP events on its 
752 non-leaf windows within the first 30 seconds of their existence, but then 
753 select for them later.  In this case, that client \fImight\fP fail to receive 
754 those events.  This isn't very likely, since programs generally select a
755 constant set of events immediately after creating their windows and then 
756 don't change them, but this is the reason that it's a good idea to install 
757 and use one of the server extensions instead, to work around this shortcoming
758 in the X protocol.
759 .TP 8
760 .B Machine Load
761 Although this program ``nices'' the subprocesses that it starts, 
762 graphics-intensive subprograms can still overload the machine by causing
763 the X server process itself (which is not ``niced'') to suck a lot of 
764 cycles.  Care should be taken to slow down programs intended for use as 
765 screensavers by inserting strategic calls to
766 .BR sleep (3)
767 or
768 .BR usleep (3)
769 (or making liberal use of any \fI\-delay\fP options which the programs 
770 may provide.)
771
772 Also, an active screensaver will cause your X server to be pretty much 
773 permanently swapped in; but the same is true of any program that draws
774 periodically, like 
775 .BR xclock (1)
776 or
777 .BR xload (1).
778 .TP 8
779 .B Latency and Responsiveness
780 If the subprocess is drawing too quickly and the connection to the X
781 server is a slow one (such as an X terminal running over a phone line) then 
782 the screensaver might not turn off right away when the user becomes active
783 again (the
784 .BR ico (1)
785 demo has this problem if being run in full-speed mode).  This can be
786 alleviated by inserting strategic calls to
787 .BR XSync (3)
788 in code intended for use as a screensaver.  This prevents too much graphics
789 activity from being buffered up.
790 .TP 8
791 .B Locking and XDM
792 If xscreensaver has been launched from XDM, you will need to cause the
793 xscreensaver daemon to exit and restart in order to lock the screen.
794
795 The reason for this is, if xscreensaver has been launched by XDM, that
796 means it was launched \fIbefore\fP you logged in: so it has no way of
797 knowing who the logged-in user is, and therefore, whose password it
798 should prompt for.
799
800 So if you want to use it as a locker, you must start it with your user id.
801 If it has already been started by \fIxdm\fP, you can kill it by sending
802 it the \fBexit\fP command, and then re-launching it as you, by putting
803 something like the following in your personal X startup script:
804 .EX
805 xscreensaver-command -exit
806 xscreensaver &
807 .EE
808 .TP 8
809 .B Locking and root logins
810 An implication of the above is that if you log in as \fIroot\fP on the
811 console, xscreensaver will refuse to lock the screen (because it can't tell
812 the difference between \fIroot\fP being logged in on the console, and a
813 normal user being logged in on the console but xscreensaver having been run
814 by
815 .BR xdm (1)).
816
817 The solution to this is simple: you shouldn't be logging in on the console
818 as \fIroot\fP in the first place!  (What, are you crazy or something?)  You 
819 should log in as you, and
820 .BR su (1)
821 to \fIroot\fP as necessary.  People who spend their day logged in 
822 as \fIroot\fP are just begging for disaster.
823 .TP 8
824 .B Passwords
825 If you get an error message like ``couldn't get password of \fIuser\fP'' 
826 then this probably means that you're on a system in which the
827 .BR getpwent (3)
828 library routine can only be effectively used by root.  If this is the case, 
829 then \fIxscreensaver\fP must be installed as setuid to root.  Care has 
830 been taken to make this a safe thing to do.  
831
832 It also may mean that your system uses shadow passwords instead of the
833 standard \fIgetpwent\fP interface; in that case, you may need to change
834 some options with \fIconfigure\fP and recompile.
835
836 If you change your password after xscreensaver has been launched, it will
837 continue using your old password to unlock the screen until xscreensaver
838 is restarted.  So, after you change your password, you'll have to do
839 .EX
840 xscreensaver-command -restart
841 .EE
842 to make \fIxscreensaver\fP notice.
843 .TP 8
844 .B Colormap lossage: TWM
845 The \fBinstallColormap\fP option doesn't work very well with the
846 .BR twm (1)
847 window manager and its descendants.  
848
849 There is a race condition between the screensaver and this window manager,
850 which can result in the screensaver's colormap not getting installed
851 properly, meaning the graphics hacks will appear in essentially random
852 colors.  (If the screen goes white instead of black, this is probably why.)
853
854 The
855 .BR mwm (1)
856 and
857 .BR olwm (1)
858 window managers don't seem to have this problem.  The race condition exists
859 because X does not provide a way for an OverrideRedirect window to have its
860 own colormap, short of grabbing the server (which is neither a good idea, nor
861 really possible with the current design.)  What happens is that, as soon as
862 the screensaver installs its colormap, \fBtwm\fP responds to 
863 the \fBColormapNotify\fP event that is generated by re-instaling the default
864 colormap.  Apparently, \fBtwm\fP doesn't \fIalways\fP do this; it seems to do
865 it regularly if the screensaver is activated from a menu item, but seems to
866 not do it if the screensaver comes on of its own volition, or is activated
867 from another console.  Any thoughts on this problem are welcome...
868 .TP 8
869 .B Colormap lossage: XV, XAnim, XEarth
870 Some programs don't operate properly on visuals other than the default one,
871 or with colormaps other than the default one.  See the discussion of the
872 magic "default-n" visual name in the description of the \fBprograms\fP 
873 resource in the \fIConfiguration\fP section.  When programs only work with
874 the default colormap, you need to use a syntax like this:
875 .EX
876     default-n: xv -root image-1.gif -quit  \\n\\
877     default-n: xearth -nostars -wait 0     \\n\\
878 .EE
879 It would also work to turn off the \fBinstallColormap\fP option altogether,
880 but that would deny extra colors to those programs that \fIcan\fP take
881 advantage of them.
882 .TP 8
883 .B XView Clients
884 Apparently there are some problems with XView programs getting confused
885 and thinking that the screensaver window is the real root window even when
886 the screensaver is not active: ClientMessages intended for the window manager
887 are sent to the screensaver window instead.  This could be solved by making
888 xscreensaver forward all unrecognised ClientMessages to the real root window,
889 but there may be other problems as well.  If anyone has any insight on the
890 cause of this problem, please let me know.  (XView is an X11 toolkit that 
891 implements the (quite abominable) Sun OpenLook look-and-feel.)
892 .TP 8
893 .B MIT Extension and Fading
894 When using the \fBMIT-SCREEN-SAVER\fP extension in conjunction with 
895 the \fBfade\fP option, you may notice an unattractive flicker just before 
896 the fade begins.  This is because the server maps a black window just before 
897 it tells the \fIxscreensaver\fP process to activate.  The \fIxscreensaver\fP 
898 process immediately unmaps that window, but this results in a flicker.  I 
899 haven't figured a way  to get around this; it seems to be a fundamental
900 property of the (mis-) design of this server extension.
901
902 It sure would be nice if someone would implement the \fBSGI SCREEN_SAVER\fP
903 extension in XFree86; it's dead simple, and works far better than the 
904 overengineered and broken \fBMIT-SCREEN-SAVER\fP extension.
905 .TP 8
906 .B Lesstif (Motif clone)
907 \fIDemo Mode\fP is buggy if XScreenSaver was compiled against really old 
908 versions Lesstif; if you use Lesstif, make sure you use version 0.82 or newer.
909 .TP 8
910 .B Athena Widgets
911 If you compiled against the Athena widget toolkit, the dialog boxes are
912 pretty ugly, especially the password dialog.  Use Motif!  If you don't
913 have OSF Motif, use GNU Lesstif, it's free: http://www.lesstif.org/
914 .TP 8
915 .B SGI Power Saver
916 If you're running Irix 6.3, you might find that your monitor is powering down
917 after an hour or two even if you've told it not to.  This is fixed by SGI
918 patches 2447 and 2537.
919 .TP 8
920 .B OpenGL Programs and Visuals
921 Some of the graphics demos included with xscreensaver make use of the 
922 OpenGL (or MesaGL) 3D library, if it is available.  It is possible (even 
923 likely) that \fIxscreensaver\fP's notion of the ``\fIbest\fP'' visual is 
924 not quite right for these GL programs.  
925
926 The odd thing about GL programs is that, unlike normal X11 programs, they
927 tend to work best on a visual \fIhalf\fP as deep as the depth of the screen,
928 since that way, they can do double-buffering.  Try it and see, but you will
929 probably find that, for these particular programs, you should specify the
930 deepest visual that is half as deep as the screen.  (See the discussion
931 of the \fBprograms\fP resource in the \fIConfiguration\fP section, above.)
932
933 For example, on a screen that supports both 24-bit TrueColor and 12-bit
934 PseudoColor visuals, the 12-bit visual will probably work best (this is true
935 of base-model SGI Indys: the 0x29 visual is the one you want.)  Oddly, on 
936 SGI O2s (machines that have serious hardware support for GL), the 12-bit
937 PseudoColor visual looks awful (you get a black and white, flickery image.)
938 On these machines, the visual you want turns out to be 0x31.  However, 0x31
939 is but \fIone\fP of the \fIeight\fP 15-bit TrueColor visuals (yes, 8, and 
940 yes, 15) that the O2 X server provides.  This is the only visual that works
941 properly: as far as 
942 .BR xdpyinfo (1)
943 is concerned, all of the 15-bit TrueColor visuals are identical, but some
944 flicker like mad, and some have deeply weird artifacts (such as hidden 
945 surfaces that show through, as if depth worked backwards!)  
946
947 I suppose these other visuals must be tied to some arcane hardware feature...
948 If anyone would care to explain it to me, that would be great.
949
950 Your mileage, therefore, may vary dramatically.
951 .TP 8
952 .B Red Hot Lava
953 There need to be a lot more graphics hacks.  In particular, there should be
954 a simulation of a Lavalite (tm).
955 .SH ENVIRONMENT
956 .PP
957 .TP 8
958 .B DISPLAY
959 to get the default host and display number, and to inform the sub-programs
960 of the screen on which to draw.
961 .TP 8
962 .B PATH
963 to find the sub-programs to run.
964 .TP 8
965 .B XENVIRONMENT
966 to get the name of a resource file that overrides the global resources
967 stored in the RESOURCE_MANAGER property.
968 .SH UPGRADES
969 The latest version can always be found at 
970 http://people.netscape.com/jwz/xscreensaver/
971 .SH SEE ALSO
972 .BR X (1),
973 .BR xscreensaver\-command (1),
974 .BR xdm (1),
975 .BR ant (1),
976 .BR atlantis (1),
977 .BR attraction (1),
978 .BR blitspin (1),
979 .BR bouboule (1),
980 .BR braid (1),
981 .BR bsod (1),
982 .BR bubbles (1),
983 .BR cage (1),
984 .BR coral (1),
985 .BR cynosure (1),
986 .BR decayscreen (1),
987 .BR deco (1),
988 .BR drift (1),
989 .BR epicycle (1),
990 .BR fadeplot (1),
991 .BR flag (1),
992 .BR flame (1),
993 .BR forest (1),
994 .BR galaxy (1),
995 .BR gears (1),
996 .BR goop (1),
997 .BR grav (1),
998 .BR greynetic (1),
999 .BR halo (1),
1000 .BR helix (1),
1001 .BR hopalong (1),
1002 .BR hypercube (1),
1003 .BR ifs (1),
1004 .BR imsmap (1),
1005 .BR interference (1),
1006 .BR jigsaw (1),
1007 .BR julia (1),
1008 .BR kaleidescope (1),
1009 .BR laser (1),
1010 .BR lightning (1),
1011 .BR lisa (1),
1012 .BR lissie (1),
1013 .BR lmorph (1),
1014 .BR maze (1),
1015 .BR moebius (1),
1016 .BR moire (1),
1017 .BR moire2 (1),
1018 .BR morph3d (1),
1019 .BR mountain (1),
1020 .BR munch (1),
1021 .BR noseguy (1),
1022 .BR pedal (1),
1023 .BR penrose (1),
1024 .BR pipes (1),
1025 .BR pyro (1),
1026 .BR qix (1),
1027 .BR rd-bomb (1),
1028 .BR rocks (1),
1029 .BR rorschach (1),
1030 .BR rotor (1),
1031 .BR rubik (1),
1032 .BR sierpinski (1),
1033 .BR slidescreen (1),
1034 .BR slip (1),
1035 .BR sphere (1),
1036 .BR spiral (1),
1037 .BR sproingies (1),
1038 .BR stairs (1),
1039 .BR starfish (1),
1040 .BR strange (1),
1041 .BR superquadrics (1),
1042 .BR swirl (1),
1043 .BR triangle (1),
1044 .BR truchet (1),
1045 .BR vines (1),
1046 .BR worm (1),
1047 .BR xjack (1),
1048 .BR xlyap (1),
1049 .BR xroger (1),
1050 .BR bongo (1),
1051 .BR ico (1),
1052 .BR xaos (1),
1053 .BR xbouncebits (1),
1054 .BR xcthugha (1),
1055 .BR xdaliclock (1),
1056 .BR xfishtank (1),
1057 .BR xmountains (1),
1058 .BR xsplinefun (1),
1059 .BR xswarm (1),
1060 .BR xtacy (1),
1061 .BR xv (1),
1062 .BR xwave (1).
1063 .SH COPYRIGHT
1064 Copyright \(co 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
1065 by Jamie Zawinski.  Permission to use, copy, modify, distribute, and sell
1066 this software and its documentation for any purpose is hereby granted without
1067 fee, provided that the above copyright notice appear in all copies and that
1068 both that copyright notice and this permission notice appear in supporting
1069 documentation.  No representations are made about the suitability of this
1070 software for any purpose.  It is provided "as is" without express or implied
1071 warranty.
1072 .SH AUTHOR
1073 Jamie Zawinski <jwz@netscape.com>.  Written in late 1991; first posted
1074 to comp.sources.x on 13-Aug-1992.
1075
1076 Please let me know if you find any bugs or make any improvements.
1077 .SH ACKNOWLEDGEMENTS
1078 Thanks to David Wojtowicz for implementing \fIlockTimeout\fP.
1079
1080 Thanks to Martin Kraemer for adding support for shadow passwords and
1081 locking-disabled diagnostics.
1082
1083 Thanks to the many people who have contributed graphics demos to the package.
1084
1085 Thanks to Patrick Moreau for the VMS port.
1086
1087 Thanks to Mark Bowyer for figuring out how to hook it up to CDE.
1088
1089 And huge thanks to Jon A. Christopher for implementing the Athena dialog
1090 support, back in the days before Lesstif was a viable alternative to Motif.