1 ..de EX \"Begin example
14 .TH XScreenSaver 1 "31-May-97" "X Version 11"
16 xscreensaver - graphics hack and screen locker, launched when the user is idle
19 [\-display \fIhost:display.screen\fP] [\-timeout \fIint\fP] [\-cycle \fIint\fP] [\-nice \fIint\fP] [\-lock] [\-no\-lock] [\-lock\-timeout \fIint\fP] [\-demo] [\-visual \fIvisual\fP] [\-install] [\-no\-install] [\-verbose] [\-silent] [\-xidle\-extension] [\-no\-xidle\-extension] [\-sgi\-extension] [\-no\-sgi\-extension] [\-mit\-extension] [\-no\-mit\-extension] [\-xrm \fIresources\fP]
21 The \fIxscreensaver\fP program waits until the keyboard and mouse have been
22 idle for a period, and then runs a graphics demo chosen at random. It
23 turns off as soon as there is any mouse or keyboard activity.
25 This program can lock your terminal in order to prevent others from using it,
26 though its default mode of operation is merely to display pretty pictures on
27 your screen when it is not in use.
29 The benefit that this program has over the combination of the
33 programs is the ease with which new graphics hacks can be installed. You
34 don't need to recompile (or even re-run) this program to add a new display
38 accepts the following command line options:
40 .B \-timeout \fIminutes\fP
41 The screensaver will activate after the keyboard and mouse have been idle
42 for this many minutes. Default 10.
44 .B \-cycle \fIminutes\fP
45 After the screensaver has been running for this many minutes, the currently
46 running graphics hack sub-process will be killed (with \fBSIGTERM\fP), and a
47 new one started. If this is 0, then the graphics hack will not be changed:
48 only one demo will run until the screensaver is deactivated by user activity.
51 .B \-nice \fIinteger\fP
52 The sub-processes created by \fIxscreensaver\fP will be ``niced'' to this
53 level, so that they are given lower priority than other processes on the
54 system, and don't increase the load unnecessarily. The default is 20.
56 (Higher numbers mean lower priority; see
61 Enable locking: before the screensaver will turn off, it requires you to
62 type the password of the person who launched the screensaver, or the root
63 password. (Note: this doesn't work if the screensaver is launched
66 because it can't know the user-id of the logged-in user.)
69 Disable locking. This is the default.
71 .B \-lock\-timeout \fIminutes\fP
72 This is how long after the screensaver activates that locking is enabled.
73 For example, if this is 5, and \fI\-timeout\fP is 10, then after 10 minutes,
74 the screen would blank. If there was user activity at 12 minutes, no password
75 would be required. But, if there was user activity at 15 minutes or later
76 (\fI\-lock\-timeout\fP minutes after activation) then a password would be
77 required. The default is 0, meaning that if locking is enabled, then
78 a password will be required as soon as the screensaver activates.
81 Enter the interactive demo mode immediately after startup. Normally
82 demo mode is invoked via the
83 .BR xscreensaver\-command (1)
84 program, but this is a shortcut for new users. See below for a description
85 of how demo-mode works.
87 .B \-visual \fIvisual\fP
88 Specify which X visual to use by default. Legal values are:
92 Use the screen's default visual (the visual of the root window.)
96 Use the visual which supports the most colors. Note, however, that the
97 visual with the most colors might be a TrueColor visual, which does not
98 support colormap animation.
101 Use a monochrome visual, if there is one.
104 Use a grayscale or staticgray visual, if there is one and it has more than
105 one plane (that is, it's not monochrome.)
108 Use the best of the color visuals, if there are any.
111 where \fIclass\fP is one
113 of \fBStaticGray\fP, \fBStaticColor\fP, \fBTrueColor\fP, \fBGrayScale\fP, \fBPseudoColor\fP,
114 or \fBDirectColor\fP. Selects the deepest visual of
118 where \fInumber\fP (decimal or hex) is interpreted as a visual id number,
121 program; in this way you can have finer control over exactly which visual
122 gets used, for example, to select a shallower one than would otherwise
127 Note that this option specifies only the \fIdefault\fP visual that will
128 be used: the visual used may be overridden on a program-by-program basis.
129 See the description of the \fBprograms\fP resource, below.
133 When using a non-default visual, install a private colormap while the
134 screensaver is active, so that the graphics hacks can get as many colors as
135 possible. This is the default. (This only applies when the screen's
136 default visual is being used, since non-default visuals get their own
137 colormaps automatically.)
140 Use the default colormap.
148 .B \-xidle\-extension
149 Use the \fBXIDLE\fP server extension to decide whether the user is idle.
150 This is the default if \fIxscreensaver\fP has been compiled with support
151 for this extension. On X11R4 or X11R5 systems, the XIdle method is faster
152 and more reliable than what will be done otherwise, so use it if you can.
154 .B \-no\-xidle\-extension
155 Don't use the \fBXIDLE\fP server extension.
158 Use the SGI \fBSCREEN_SAVER\fP server extension to decide whether the user
159 is idle. This is the default if \fIxscreensaver\fP has been compiled with
160 support for this extension (which is the default on SGI systems.). If it
161 is available, the \fBSCREEN_SAVER\fP method is faster and more reliable than
162 what will be done otherwise, so use it if you can.
164 .B \-no\-sgi\-extension
165 Don't use the SGI \fBSCREEN_SAVER\fP server extension.
168 Use the \fBMIT\-SCREEN\-SAVER\fP server extension to decide whether the user
169 is idle. This is the default if \fIxscreensaver\fP has been compiled with
170 support for this extension. However, this extension is flaky, so it's use
171 is not really recommended. (It also makes the \fIfade\fP option not work
174 .B \-no\-mit\-extension
175 Don't use the \fBMIT\-SCREEN\-SAVER\fP server extension.
177 \fIxscreensaver\fP understands the following resources:
180 .B timeout \fR(class \fBTime\fP)
181 Same as the \fI\-timeout\fP command-line option. Default 10 minutes.
183 .B cycle \fR(class \fBTime\fP)
184 Same as the \fI\-cycle\fP command-line option. Default 10 minutes.
186 .B nice \fR(class \fBNice\fP)
187 Same as the \fI\-nice\fP command-line option. Default 10.
189 .B lock \fR(class \fBBoolean\fP)
190 Same as the \fI\-lock\fP command-line option.
192 .B lockTimeout \fR(class \fBTime\fP)
193 Same as the \fI\-lock\-timeout\fP command-line option.
195 .B passwdTimeout \fR(class \fBTime\fP)
196 If the screen is locked, then this is how many seconds the password dialog box
197 should be left on the screen before giving up (default 30.) This should not
198 be too large: the X server is grabbed for the duration that the password
199 dialog box is up (for security purposes) and leaving the server grabbed for
200 too long can cause problems.
202 .B verbose \fR(class \fBBoolean\fP)
203 Same as the \fI\-verbose\fP command-line option.
205 .B xidle \fR(class \fBBoolean\fP)
206 Same as the \fI\-xidle\fP command-line option.
208 .B fade \fR(class \fBBoolean\fP)
209 If this is true, then when the screensaver activates, the current contents
210 of the screen will fade to black instead of simply winking out. This only
211 works on displays with writable colormaps, that is, if the screen's default
212 visual is a PseudoColor visual. Default true. A fade will also be done when
213 switching graphics hacks (when the \fIcycle\fP timer expires.)
215 .B unfade \fR(class \fBBoolean\fP)
216 If this is true, then when the screensaver deactivates, the original contents
217 of the screen will fade in from black instead of appearing immediately. This
218 only works on displays with writable colormaps, and if \fIfade\fP is true
219 as well. Default false.
221 .B fadeSeconds \fR(class \fBTime\fP)
222 If \fIfade\fP is true, this is how long the fade will be in
225 .B fadeTicks \fR(class \fBInteger\fP)
226 If \fIfade\fP is true, this is how many times a second the colormap will
227 be changed to effect a fade. Higher numbers yield smoother fades, but
228 may make the fades take longer than the specified \fIfadeSeconds\fP if
229 your server isn't fast enough to keep up. Default 20.
231 .B visualID \fR(class \fBVisualID\fP)
232 Same as the \fI\-visual\fP command-line option. Default \fBdefault\fP.
234 .B installColormap \fR(class \fBBoolean\fP)
235 Same as the \fI\-install\fP command-line option. Default true.
237 .B captureStderr \fR(class \fBBoolean\fP)
238 Whether \fIxscreensaver\fP should redirect its standard-error stream to the
239 window itself. Since its nature is to take over the screen, you would not
240 normally see error messages generated by the screensaver or the programs it
241 runs; this resource will cause the output of all relevant programs to be
242 drawn on the screensaver window itself instead of written to the controlling
243 terminal of the screensaver driver process. Default true.
245 .B captureStdout \fR(class \fBBoolean\fP)
246 Like \fBcaptureStderr\fP but for the standard-output stream. Default true.
248 .B font \fR(class \fBFont\fP)
249 The font used for the stdout/stderr text, if \fBcaptureStdout\fP or
250 \fBcaptureStderr\fP are true. Default \fB*\-medium\-r\-*\-140\-*\-m\-*\fP
251 (a 14 point fixed-width font.)
253 .B textForeground \fR(class \fBForeground\fP)
254 The foreground color used for the stdout/stderr text, if \fBcaptureStdout\fP
255 or \fBcaptureStderr\fP are true. Default: Yellow.
257 .B textBackground \fR(class \fBBackground\fP)
258 The background color used for the stdout/stderr text, if \fBcaptureStdout\fP
259 or \fBcaptureStderr\fP are true. Default: Black.
261 .B programs \fR(class \fBPrograms\fP)
262 The graphics hacks which \fIxscreensaver\fP runs when the user is idle.
263 The value of this resource is a string, one \fIsh\fP-syntax command per line.
264 Each line must contain exactly one command -- no semicolons, no ampersands.
266 When the screensaver starts up, one of these is selected at random, and
267 run. After the \fIcycle\fP period expires, it is killed, and another
270 If the value of this resource is empty, then no programs will be run; the
271 screen will simply be made black.
273 If the display has multiple screens, then a different program will be run
276 Note that you must escape the newlines; here is an example of how you
277 might set this in your \fI.Xdefaults\fP file:
280 xscreensaver.programs: \\
282 ico -r -faces -sleep 1 -obj ico \\n\\
283 xdaliclock -builtin2 -root \\n\\
284 xv -root -rmode 5 image.gif -quit \\n
287 To use a program as a screensaver, two things are required: that that
288 program draw on the root window (or be able to be configured to draw on
289 the root window); and that that program understand ``virtual root''
290 windows, as used by virtual window managers such as \fItvtwm\fP. (Generally,
291 this is accomplished by just including the \fI"vroot.h"\fP header file in
292 the program's source.)
294 If there are some programs that you want to run only when using a color
295 display, and others that you want to run only when using a monochrome
296 display, you can specify that like this:
299 mono: mono-program -root \\n\\
300 color: color-program -root \\n\\
304 More generally, you can specify the kind of visual that should be used for
305 the window on which the program will be drawing. For example, if one
306 program works best if it has a colormap, but another works best if it has
307 a 24-bit visual, both can be accomidated:
310 PseudoColor: cmap-program -root \\n\\
311 TrueColor: 24bit-program -root \\n\\
315 (This sort of thing used to be accomplished with the \fIcolorPrograms\fP
316 and \fImonoPrograms\fP resources, but those resources have now been removed;
317 a warning will be issued if they are used.)
319 If you specify a particular visual for a program, and that visual does not
320 exist on the screen, then that program will not be chosen to run. This
321 means that on displays with multiple screens of different depths, you can
322 arrange for appropriate hacks to be run on each. For example, if one screen
323 is color and the other is monochrome, hacks that look good in mono can be
324 run on one, and hacks that only look good in color will show up on the other.
328 Normally you won't need to change the following resources:
330 .B bourneShell \fR(class \fBBourneShell\fP)
331 The pathname of the shell that \fIxscreensaver\fP uses to start subprocesses.
332 This must be whatever your local variant of \fB/bin/sh\fP is -- in particular,
333 it must not be \fBcsh\fP.
335 .B windowCreationTimeout \fR(class \fBTime\fP)
336 When server extensions are not in use, this controls the delay between when
337 windows are created and when \fIxscreensaver\fP selects events on them.
340 .B pointerPollTime \fR(class \fBTime\fP)
341 When server extensions are not in use, this controls how
342 frequently \fIxscreensaver\fP checks to see if the mouse position or buttons
343 have changed. Default 5 seconds.
345 .B initialDelay \fR(class \fBTime\fP)
346 When server extensions are not in use, \fIxscreensaver\fP will wait this many
347 seconds before selecting events on existing windows, under the assumption that
348 \fIxscreensaver\fP is started during your login procedure, and the window
349 state may be in flux. Default 30 seconds.
351 .B overlayStderr \fR(class \fBBoolean\fP)
352 If \fBcaptureStderr\fP or \fBcaptureStdout\fP are True, and your server
353 supports ``overlay'' visuals, then the text will be written into one of
354 the higher layers instead of into the same layer as the running screenhack.
355 Set this to False to disable that (though you shouldn't need to.)
357 When it is time to activate the screensaver, a full-screen black window is
358 created on each screen of the display. The window or windows is given the
359 appropriate properties so that, to any subsequently-created programs, it
360 will appear to be a ``virtual root'' window. Because of this, any program
361 which draws on the root window (and which understands virtual roots) can be
362 used as a screensaver.
364 When the user becomes active again, the screensaver windows are unmapped and
365 the running subprocesses are killed by sending them \fBSIGTERM\fP. This is
366 also how the subprocesses are killed when the screensaver decides that it's
367 time to run a different demo: the old one is killed and a new one is launched.
369 Before launching a subprocess, \fIxscreensaver\fP stores an appropriate value
370 for \fB$DISPLAY\fP in the environment that the child will recieve. (This is
371 so that if you start \fIxscreensaver\fP with a \fI-display\fP argument, the
372 programs which \fIxscreensaver\fP launches will draw on the same display;
373 and so that the child will end up drawing on the appropriate screen of a
374 multi-headed display.)
376 When the screensaver turns off, or is killed, care is taken to restore
377 the ``real'' virtual root window if there is one. Because of this, it is
378 important that you not kill the screensaver process with \fIkill -9\fP if
379 you are running a virtual-root window manager. If you kill it with \-9,
380 you may need to restart your window manager to repair the damage. This
381 isn't an issue if you aren't running a virtual-root window manager.
383 For all the gory details, see the commentary at the top of xscreensaver.c.
385 You can control a running screensaver process by using the
386 .BR xscreensaver\-command (1)
389 You can run \fIxscreensaver\fP from your xdm session, so that the
390 screensaver will run even when nobody is logged in on the console.
391 Simply add \fB"xscreensaver &"\fP to your \fI/usr/lib/X11/xdm/Xsetup\fP
392 file. Because \fIxdm\fP grabs the keyboard, keypresses will not make
393 the screensaver deactivate, but any mouse activity will.
395 (If your system does not seem to be executing the \fIXsetup\fP file, you
396 may need to configure it to do so -- the traditional way to do this is
397 to make that file the value of the \fIDisplayManager*setup\fP resource
398 in the \fIxdm-config\fP file. See the man page for
402 Users may want to add \fB"xscreensaver-command -restart"\fP to their
403 startup scripts, so that the screensaver will be reinitialized with
404 their private resource settings when they log in.
406 It is safe to run this program as root (as \fIxdm\fP is likely to do.) If
407 run as root, \fIxscreensaver\fP changes its effective user and group ids to
408 something safe (like \fI"nobody"\fP) before connecting to the X server
409 or launching user-specified programs.
411 Locking doesn't work if the screensaver is launched by \fIxdm\fP. To get
412 around this, you can run the screensaver from \fIxdm\fP without locking,
413 and kill and restart it from your personal X startup script to enable
414 locking; for example:
417 xscreensaver-command -exit ; xscreensaver
420 If \fIxscreensaver\fP receives the \fBDEMO\fP ClientMessage, which is done
421 by running the \fBxscreensaver\-command\fP program with the \fB\-demo\fP
422 option, the screensaver will black the screen and pop up a dialog box from
423 which you can examine and experiment with the client programs.
425 The dialog box contains a scrolling list, a text field, and a number of
428 Double-clicking on one of the programs in the list will run it. Clicking
429 the mouse again will bring the dialog box back.
431 Single-clicking in the list will place the indicated program and its args
432 in the text field to be edited. Edit the arguments and hit return to run
433 the program with the parameters you have specified. (Note that these are
434 one-time changes and won't be remembered; to make the changes permanent,
435 you need to edit your X resource file.)
440 Clicking this button will run the next program in the list after the
441 currently-selected one, and will scroll around to the top when it reaches
445 Opposite of Run Next; at the top, it scrolls around to the bottom.
448 This pops up a second dialog box, in which you have the option to
449 interactively change most of the screensaver's operational parameters,
450 such as its timeouts, and whether it should lock the screen. Changing
451 these parameters here will affect only the running \fIxscreensaver\fP
452 process; to make the changes permanent, you need to edit your X resource
456 Returns to normal screensaver operation.
459 This causes the X resource database to be re-read, to pick up any changes
460 you might have made. This works by causing the screensaver process to exit
461 and then restart itself with the same command-line arguments. This is just
462 like the \fI\-restart\fP argument to
463 .BR xscreensaver\-command (1)
464 except that when executed from this button, the screensaver will
465 automatically return to demo mode after restarting.
467 (This is not a bug, but) note that as of release 1.32, the \fBcolorPrograms\fP
468 and \fBmonoPrograms\fP resources are no longer used: they have been
469 supplanted by the extended syntax of the \fBprograms\fP resource (see above.)
472 If you are not making use of one of the server extensions (\fBXIDLE\fP,
473 \fBSCREEN_SAVER\fP, or \fBMIT-SCREEN-SAVER\fP), then it is possible, in rare
474 situations, for \fIxscreensaver\fP to interfere with event propagation and make
475 another X program malfunction. For this to occur, that other application
476 would need to \fInot\fP select \fBKeyPress\fP events on its non-leaf windows
477 within the first 30 seconds of their existence, but then select for them later.
478 In this case, that client \fImight\fP fail to receive those events.
479 This isn't very likely, since programs generally select a constant set
480 of events immediately after creating their windows and then don't change
481 them, but this is the reason that it's a good idea to install and use one
482 of the server extensions instead, to work around this shortcoming in the
486 Although this program ``nices'' the subprocesses that it starts,
487 graphics-intensive subprograms can still overload the machine by causing
488 the X server process itself (which is not ``niced'') to suck a lot of
489 cycles. Care should be taken to slow down programs intended for use as
490 screensavers by inserting strategic calls to
494 (or making liberal use of any \fI\-delay\fP options which the programs
497 Also, an active screensaver will cause your X server to be pretty much
498 permanently swapped in; but the same is true of any program that draws
504 Latency and Responsiveness
505 If the subprocess is drawing too quickly and the connection to the X
506 server is a slow one (such as an X terminal running over a phone line) then
507 the screensaver might not turn off right away when the user becomes active
510 demo has this problem if being run in full-speed mode). This can be
511 alleviated by inserting strategic calls to
513 in code intended for use as a screensaver. This prevents too much graphics
514 activity from being buffered up.
517 Locking doesn't work if the screensaver is launched by \fIxdm\fP.
518 The reason for this is that when it is launched by \fIxdm\fP, the
519 screensaver process is owned by some standard user id (such as \fIroot\fP
520 or \fIdaemon\fP) instead of the user who is logged in on the console:
521 because the screensaver was started \fIbefore\fP anyone was logged in.
522 In order for the screensaver to prompt for the password of the person
523 who had logged in from \fIxdm\fP, it would need to know who that user was,
524 and there is no reliable and safe way to figure that out. (And even if
525 there was, there would be some other security issues here as well.)
527 So if you want to use it as a locker, you must start it with your user id.
528 If it has already been started by \fIxdm\fP, you can kill it with
529 \fBxscreensaver-command -exit\fP, and then start it again as you.
532 If you get an error message like ``couldn't get password of \fIuser\fP''
533 then this probably means that you're on a system in which the
535 library routine can only be effectively used by root. If this is the case,
536 then \fIxscreensaver\fP must be installed as setuid to root. Care has
537 been taken to make this a safe thing to do.
539 It also may mean that your system uses shadow passwords instead of the
540 standard \fIgetpwent\fP interface; in that case, you may need to change
541 some options in \fIconfig.h\fP and recompile.
544 The \fBinstallColormap\fP option doesn't work very well with the
546 window manager and its descendants.
548 There is a race condition between the screensaver and this window manager,
549 which can result in the screensaver's colormap not getting installed
550 properly, meaning the graphics hacks will appear in essentially random
551 colors. (If the screen goes white instead of black, this is probably why.)
557 window managers don't seem to have this problem. The race condition exists
558 because X apparently does not provide a way for an OverrideRedirect window to
559 have its own colormap, short of grabbing the server (which is neither a good
560 idea, nor really possible with the current design.) What happens is that, as
561 soon as the screensaver installs its colormap, \fBtwm\fP responds to
562 the \fBColormapNotify\fP event that is generated by re-instaling the default
563 colormap. Apparently, \fBtwm\fP doesn't \fIalways\fP do this; it seems to do
564 it regularly if the screensaver is activated from a menu item, but seems to
565 not do it if the screensaver comes on of its own volition, or is activated
566 from another console. Any thoughts on this problem are welcome...
569 Apparently there are some problems with XView programs getting confused
570 and thinking that the screensaver window is the real root window even when
571 the screensaver is not active: ClientMessages intended for the window manager
572 are sent to the screensaver window instead. This could be solved by making
573 xscreensaver forward all unrecognised ClientMessages to the real root window,
574 but there may be other problems as well. If anyone has any insight on the
575 cause of this problem, please let me know.
577 MIT Extension and Fading
578 When using the \fBMIT-SCREEN-SAVER\fP extension in conjunction with
579 the \fBfade\fP option, you may notice an unattractive flicker just before
580 the fade begins. This is because the server maps a black window just before
581 it tells the \fIxscreensaver\fP process to activate. The \fIxscreensaver\fP
582 process immediately unmaps that window, but this results in a flicker. I
583 haven't figured a way to get around this; it seems to be a fundamental
584 property of the (mis-) design of this server extension.
586 LessTif (Motif Clone)
587 Rumor has it that demo mode is buggy if XScreenSaver was compiled with the
588 GNU LessTif reimplementation of Motif. Since it works fine with OSF Motif
589 on a variety of systems, I assume these problems are due to bugs in LessTif.
590 Again, any insight would be appreciated.
593 There need to be a lot more graphics hacks. In particular, there should be
594 a simulation of a Lavalite (tm).
599 to get the default host and display number, and to inform the sub-programs
600 of the screen on which to draw.
603 to get the name of a resource file that overrides the global resources
604 stored in the RESOURCE_MANAGER property.
606 The latest version can always be found at
607 http://people.netscape.com/jwz/xscreensaver/
610 .BR xscreensaver\-command (1),
637 .BR kaleidescope (1),
668 Copyright \(co 1991, 1992, 1993, 1994, 1995, 1996, 1997 by Jamie Zawinski.
669 Permission to use, copy, modify, distribute, and sell this software and its
670 documentation for any purpose is hereby granted without fee, provided that
671 the above copyright notice appear in all copies and that both that copyright
672 notice and this permission notice appear in supporting documentation. No
673 representations are made about the suitability of this software for any
674 purpose. It is provided "as is" without express or implied warranty.
676 Jamie Zawinski <jwz@netscape.com>. Written in late 1991; first posted
677 to comp.sources.x on 13-Aug-1992.
679 Please let me know if you find any bugs or make any improvements.
681 Thanks to David Wojtowicz for implementing \fIlockTimeout\fP.
683 Thanks to Martin Kraemer for adding support for shadow passwords and
684 locking-disabled diagnostics.
686 Thanks to the many people who have contributed graphics demos to the package.
688 Thanks to Patrick Moreau for the VMS port.
690 And huge thanks to Jon A. Christopher for implementing the Athena dialog
691 support, so that locking and demo-mode work even if you don't have Motif.