14 .TH XScreenSaver 1 "6-Jan-95" "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] [\-verbose] [\-silent] [\-xidle] [\-no-xidle] [\-lock] [\-no-lock] [\-lock\-timeout \fIint\fP] [\-demo] [\-visual \fIvisual\fP] [\-install] [\-no-install] [\-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 options:
40 .B \-timeout \fIminutes\fP
41 The screensaver will activate after the keyboard and mouse have been idle
42 for this many minutes.
44 .B \-cycle \fIminutes\fP
45 After the screensaver has been running for this many minutes, the currently
46 running sub-process will be killed (with \fBSIGTERM\fP), and a new one
47 started. If this is 0, then the sub-process will not be killed; only one
48 demo will run until the screensaver is deactivated by user activity.
50 .B \-nice \fIinteger\fP
51 The sub-processes created by \fIxscreensaver\fP will be ``niced'' to this
52 level, so that they do not consume cycles that are needed elsewhere.
61 Use the \fBXIDLE\fP server extension to decide whether the user is idle.
62 This is the default if \fIxscreensaver\fP has been compiled with support
63 for this extension. On X11R4 or X11R5 systems, the XIdle method is faster
64 and more reliable than what will be done otherwise, so use it if you can.
66 .B \-no\-xidle\-extension
67 Don't use the \fBXIDLE\fP server extension.
70 Use the \fBMIT\-SCREEN\-SAVER\fP server extension to decide whether the user
71 is idle. This is the default if \fIxscreensaver\fP has been compiled with
72 support for this extension. On X11R6 systems, the \fBMIT\-SCREEN\-SAVER\fP
73 method is faster and more reliable than what will be done otherwise, so use
76 .B \-no\-ss\-extension
77 Don't use the \fBMIT\-SCREEN\-SAVER\fP server extension.
80 Enable locking: before the screensaver will turn off, it requires you to
81 type the password of the person who launched the screensaver, or the root
82 password. (Note: this doesn't work if the screensaver is launched
85 because it can't know the user-id of the logged-in user.)
88 Disable locking. This is the default.
90 .B \-lock\-timeout \fIminutes\fP
91 This is how long after the screensaver activates that locking is enabled.
92 For example, if this is 5, then any user activity within five minutes of
93 the time when the screensaver activated will cause the screen to unblank
94 without requiring a password. After 5 minutes, a password will be
95 required. The default is 0, meaning that if locking is enabled, then
96 a password will be required as soon as the screensaver activates.
98 .B \-visual \fIvisual\fP
99 Specify which visual to use. Legal values are:
103 Use the visual which supports the most writable color cells; this is
107 Use the screen's default visual (the visual of the root window.) This is
108 not necessarily the most colorful visual, which is why it is not the default.
111 One of \fBStaticGray\fP, \fBStaticColor\fP, \fBTrueColor\fP, \fBGrayScale\fP,
112 \fBPseudoColor\fP, or \fBDirectColor\fP. Selects the deepest visual of
116 A number (decimal or hex) is interpreted as a visual id number, as reported
119 program; in this way you can select a shallower visual if desired.
123 Use the default colormap. This is the default.
126 Install a private colormap while the screensaver is on, so that the graphics
127 hacks can get as many colors as possible.
130 Enter the interactive demo mode immediately after startup. Normally
131 demo mode is invoked via the
132 .BR xscreensaver\-command (1)
135 \fIxscreensaver\fP understands the following resources:
138 .B timeout \fR(class \fBTime\fP)
139 Same as the \fI\-timeout\fP command-line option. Default 10 minutes.
141 .B cycle \fR(class \fBTime\fP)
142 Same as the \fI\-cycle\fP command-line option. Default 10 minutes.
144 .B nice \fR(class \fBNice\fP)
145 Same as the \fI\-nice\fP command-line option. Default 10.
147 .B verbose \fR(class \fBBoolean\fP)
148 Same as the \fI\-verbose\fP command-line option.
150 .B xidle \fR(class \fBBoolean\fP)
151 Same as the \fI\-xidle\fP command-line option.
153 .B lock \fR(class \fBBoolean\fP)
154 Same as the \fI\-lock\fP command-line option.
156 .B lockTimeout \fR(class \fBTime\fP)
157 Same as the \fI\-lock\-timeout\fP command-line option.
159 .B fade \fR(class \fBBoolean\fP)
160 If this is true, then when the screensaver activates, the current contents
161 of the screen will fade to black instead of simply winking out. This only
162 works on displays with writable colormaps. Default true. A fade will also
163 be done when switching graphics hacks (when the \fIcycle\fP timer expires.)
165 .B unfade \fR(class \fBBoolean\fP)
166 If this is true, then when the screensaver deactivates, the original contents
167 of the screen will fade in from black instead of appearing immediately. This
168 only works on displays with writable colormaps, and if \fIfade\fP is true
169 as well. Default false.
171 .B fadeSeconds \fR(class \fBTime\fP)
172 If \fIfade\fP is true, this is how long the fade will be in
175 .B fadeTicks \fR(class \fBInteger\fP)
176 If \fIfade\fP is true, this is how many times a second the colormap will
177 be changed to effect a fade. Higher numbers yield smoother fades, but
178 may make the fades take longer if your server isn't fast enough to keep
181 .B installColormap \fR(class \fBBoolean\fP)
182 Same as the \fI\-install\fP command-line option. Default false.
184 .B passwdTimeout \fR(class \fBTime\fP)
185 If \fIlock\fP is true, this is how many seconds the password dialog box
186 should be left on the screen before giving up (default 30.) This should
187 not be too large: the X server is grabbed for the duration that the password
188 dialog box is up (for security purposes) and leaving the server grabbed for
189 too long can cause problems.
191 .B visualID \fR(class \fBVisualID\fP)
192 Same as the \fI\-visual\fP command-line option. Default \fBbest\fP.
194 .B captureStderr \fR(class \fBBoolean\fP)
195 Whether \fIxscreensaver\fP should redirect its standard-error stream to the
196 window itself. Since its nature is to take over the screen, you would not
197 normally see error messages generated by the screensaver or the programs it
198 runs; this resource will cause the output of all relevant programs to be
199 drawn on the screensaver window itself instead of written to the controlling
200 terminal of the screensaver driver process. Default: True.
202 .B captureStdout \fR(class \fBBoolean\fP)
203 Like \fBcaptureStderr\fP but for the standard-output stream. Default: True.
205 .B font \fR(class \fBFont\fP)
206 The font used for the stdout/stderr text, if \fBcaptureStdout\fP or
207 \fBcaptureStderr\fP are true. Default \fB*\-medium\-r\-*\-140\-*\-m\-*\fP
208 (a 14 point fixed-width font.)
210 .B textForeground \fR(class \fBForeground\fP)
211 The foreground color used for the stdout/stderr text, if \fBcaptureStdout\fP
212 or \fBcaptureStderr\fP are true. Default: Yellow.
214 .B textBackground \fR(class \fBBackground\fP)
215 The background color used for the stdout/stderr text, if \fBcaptureStdout\fP
216 or \fBcaptureStderr\fP are true. Default: Black.
218 .B programs \fR(class \fBPrograms\fP)
219 The graphics hacks which \fIxscreensaver\fP runs when the user is idle,
220 in addition to those specified in colorPrograms or monoPrograms (as
221 appropriate.) The value of this resource is a string, one \fIsh\fP command
222 per line. Each line must contain exactly one command -- no semicolons.
224 When the screensaver starts up, one of these is selected at random, and
225 run. After the \fIcycle\fP period expires, it is killed, and another
228 If the value of this resource (and the applicable one of \fBcolorPrograms\fP
229 or \fBmonoPrograms\fP) is empty, then no programs will be run; the screen
230 will simply be made black.
232 Note that you must escape the newlines; here is an example of how you
233 might set this in your \fI.Xdefaults\fP file:
235 xscreensaver.programs: \\
237 ico -r -faces -sleep 1 -obj ico \\n\\
238 xdaliclock -builtin2 -root \\n\\
241 To use a program as a screensaver, two things are required: that that
242 program draw on the root window (or be able to be configured to draw on
243 the root window); and that that program understand ``virtual root''
244 windows, as used by virtual window managers such as \fItvtwm\fP.
246 It is quite easy to make programs understand virtual roots if they
247 don't already: you merely need to include the file \fI"vroot.h"\fP in
248 them after the standard X includes, and recompile. This file is distributed
249 with X11r5, and is included with xscreensaver as well.
251 .B monoPrograms \fR(class \fBMonoPrograms\fP)
252 This resource is appended to the value of the \fIprograms\fP resource if
253 the display on which the screensaver is running is monochrome.
255 .B colorPrograms \fR(class \fBColorPrograms\fP)
256 This resource is appended to the value of the \fIprograms\fP resource if
257 the display on which the screensaver is running is not monochrome.
260 \fBNOTE: this means that if you want to completely replace the list of
261 programs which xscreensaver runs, you must set at least \fItwo\fP,
262 possibly \fIthree\fP resources. It is not enough to just set
263 the \fBprograms\fP resource -- you must also set \fBcolorPrograms\fP
264 or \fBmonoPrograms\fP or both.\fP
267 Normally you won't need to change the following resources:
269 .B bourneShell \fR(class \fBBourneShell\fP)
270 The pathname of the shell that \fIxscreensaver\fP uses to start subprocesses.
271 This must be whatever your local variant of \fB/bin/sh\fP is -- in particular,
272 it must not be \fBcsh\fP.
274 .B windowCreationTimeout \fR(class \fBTime\fP)
275 When \fIXIdle\fP is not in use, this controls the delay between when
276 windows are created and when \fIxscreensaver\fP selects events on them.
279 .B pointerPollTime \fR(class \fBTime\fP)
280 When \fIXIdle\fP is not in use, this controls how frequently \fIxscreensaver\fP
281 checks to see if the mouse position or buttons have changed. Default 5 seconds.
283 .B initialDelay \fR(class \fBTime\fP)
284 When \fIXIdle\fP is not in use, \fIxscreensaver\fP will wait this many seconds
285 before selecting events on existing windows, under the assumption that
286 \fIxscreensaver\fP is started during your login procedure, and the window
287 state may be in flux. Default 30 seconds.
289 When it is time to activate the screensaver, a full-screen black window is
290 created. This window is given the appropriate properties so that, to any
291 subsequently-created programs, it will appear to be a ``virtual root''
292 window. Because of this, any program which draws on the root window (and
293 which understands virtual roots) can be used as a screensaver.
295 When the user becomes active again, the screensaver window is unmapped and
296 the running subprocess is killed by sending it \fBSIGTERM\fP. This is also
297 how the subprocesses are killed when the screensaver decides that it's time
298 to run a different demo: the old one is killed and a new one is launched.
300 Before launching a subprocess, \fIxscreensaver\fP stores an appropriate value
301 for \fB$DISPLAY\fP in the environment that the child will recieve. (This is
302 so that if you start \fIxscreensaver\fP with a \fI-display\fP argument, the
303 programs which \fIxscreensaver\fP launches will draw on the same display.)
305 When the screensaver turns off, or is killed, care is taken to restore
306 the ``real'' virtual root window if there is one. Because of this, it is
307 important that you not kill the screensaver process with \fIkill -9\fP if
308 you are running a virtual-root window manager. If you kill it with \-9,
309 you may need to restart your window manager to repair the damage. This
310 isn't an issue if you aren't running a virtual-root window manager.
312 For all the gory details, see the commentary at the top of xscreensaver.c.
314 You can control a running screensaver process by using the
315 .BR xscreensaver\-command (1)
321 to get the default host and display number.
324 to get the name of a resource file that overrides the global resources
325 stored in the RESOURCE_MANAGER property.
327 You can run \fIxscreensaver\fP from your xdm session, so that the
328 screensaver will run even when nobody is logged in on the console.
329 Simply add \fB"xscreensaver &"\fP to your \fI/usr/lib/X11/xdm/Xsetup\fP
330 file. Because \fIxdm\fP grabs the keyboard, keypresses will not make
331 the screensaver deactivate, but any mouse activity will.
333 (If your system does not seem to be executing the \fIXsetup\fP file, you
334 may need to configure it to do so -- the traditional way to do this is
335 to make that file the value of the \fIDisplayManager*setup\fP resource
336 in the \fIxdm-config\fP file. See the man page for
340 Users may want to add \fB"xscreensaver-command -restart"\fP to their
341 startup scripts, so that the screensaver will be reinitialized with
342 their private resource settings when they log in.
344 It is safe to run this program as root (as \fIxdm\fP is likely to do.) If
345 run as root, \fIxscreensaver\fP changes its effective user and group ids to
346 something safe (like \fI"nobody"\fP) before connecting to the X server
347 or launching user-specified programs.
349 Locking doesn't work if the screensaver is launched by \fIxdm\fP. To get
350 around this, you can run the screensaver from \fIxdm\fP without locking,
351 and kill and restart it from your personal X startup script to enable
354 If \fIxscreensaver\fP receives the \fBDEMO\fP ClientMessage, it pops up
355 a dialog box from which you can examine and experiment with the screensaver's
358 Clicking left on an element in the scrolling list will place the indicated
359 program and its args in the text field to be edited. Edit the arguments and
360 hit return to run the program with the parameters you have specified.
362 Double-clicking on an element in the scrolling list will run the indicated
365 When a client program is launched, the dialog box is hidden. Clicking
366 any mouse button will re-expose the dialog box (but will not kill the
370 Clicking this button will run the next program in the list after the
371 currently-selected one, and will scroll around to the top when it reaches
375 Opposite of Run Next; at the top, it scrolls around to the bottom.
378 This pops up a second dialog box, in which you have the option to
379 interactively change most of the screensaver's operational parameters,
380 such as its timeouts, and whether it should hack colormaps. Changing
381 these parameters here will affect only the running \fIxscreensaver\fP
382 process; to make the changes permanent, you need to edit your X resource
386 Returns to normal screensaver operation.
389 Causes the screensaver process to exit and then restart with the same
390 command-line arguments. This causes the X resource database to be
391 re-read. This is just like the \fI\-restart\fP argument to
392 .BR xscreensaver\-command (1)
393 except that when executed from this button, the screensaver will
394 automatically return to demo mode after restarting.
397 .BR xscreensaver\-command (1),
425 If you think you have changed the \fBprograms\fP resource but the
426 screensaver is ignoring it, you are confused -- you need to set
427 the \fBcolorPrograms\fP and/or \fBmonoPrograms\fP resources as well.
428 (This is not a bug, but I mention it here because people think that
429 it is with great regularity.)
431 If you are not making use of one of the server extensions (\fBXIDLE\fP
432 or \fBMIT-SCREEN-SAVER\fP), then it is possible, in rare situations,
433 for \fIxscreensaver\fP to interfere with event propagation and make
434 another X program malfunction. For this to occur, that other application
435 would need to \fInot\fP select \fBKeyPress\fP events on its non-leaf windows
436 within the first 30 seconds of their existence, but then select for them later.
437 In this case, that client \fImight\fP fail to receive those events.
438 This isn't very likely, since programs generally select a constant set
439 of events immediately after creating their windows and then don't change
440 them, but this is the reason that it's a good idea to install and use one
441 of the server extensions instead, to work around this shortcoming in the
444 Although this program ``nices'' the subprocesses that it starts,
445 graphics-intensive subprograms can still overload the machine by causing
446 the X server process itself (which is not ``niced'') to suck a lot of
447 cycles. Care should be taken to slow down programs intended for use as
448 screensavers by inserting strategic calls to
454 Also, it will cause your X server to be pretty much permanently swapped in.
455 (but the same is true of any program that draws periodically, like xclock or
458 If the subprocess is drawing too quickly and the connection to the X
459 server is a slow one (such as an X terminal running over a phone line) then
460 the screensaver might not turn off right away when the user becomes active
463 demo has this problem if being run in full-speed mode). This can be
464 alleviated by inserting strategic calls to
466 in code intended for use as a screensaver. This prevents too much graphics
467 activity from being buffered up.
469 The screensaver only runs on the default screen of the display. If you have
470 more than one screen, you can run multiple screensaver processes, one for
471 each screen. This interacts poorly with locking. In an ideal world, the
472 screensaver would save (and lock) both screens simultaniously, and any activity
473 would restore both screens. It would be nice if one could run different hacks
474 on each screen simultaniously. However, I don't have access to a multi-headed
475 workstation, so it would be hard for me to implement something like this.
477 If you don't have Motif, you can't compile with support for locking or
480 Locking doesn't work if the screensaver is launched by \fIxdm\fP.
481 The reason for this is that when it is launched by \fIxdm\fP, the
482 screensaver process is owned by some standard user id (such as \fIroot\fP
483 or \fIdaemon\fP) instead of the user who is logged in on the console.
484 In order for the screensaver to prompt for the password of the person
485 who had logged in from \fIxdm\fP, it would need to know who that user was,
486 and there is no reliable and safe way to figure that out. (And even if
487 there was, there would be some other security issues here as well.)
489 So if you want to use it as a locker, you must start it with your user id.
490 If it has already been started by \fIxdm\fP, you can kill it with
491 \fBxscreensaver-command -exit\fP, and then start it again as you.
493 If you get an error message like ``couldn't get password of foo'' then
494 this probably means that you're on a system in which the
496 library routine can only be effectively used by root. If this is the case,
497 then \fIxscreensaver\fP must be installed as setuid to root. Care has
498 been taken to make this a safe thing to do.
500 The \fBinstallColormap\fP option doesn't work very well with the
502 window manager and its descendants. There is a race condition between the
503 screensaver and this window manager, which can result in the screensaver's
504 colormap not getting installed properly, meaning the graphics hacks will
505 appear in essentially random colors. The
509 window managers don't seem to have this problem. The race condition exists
510 because X apparently does not provide a way for an OverrideRedirect window to
511 have its own colormap, short of grabbing the server (which is neither a good
512 idea, nor really possible with the current design.) What happens is that, as
513 soon as the screensaver installs its colormap, \fBtwm\fP responds to
514 the \fBColormapNotify\fP event that is generated by re-instaling the default
515 colormap. Apparently, \fBtwm\fP doesn't \fIalways\fP do this; it seems to do
516 it regularly if the screensaver is activated from a menu item, but seems to
517 not do it if the screensaver comes on of its own volition, or is activated
518 from another console. Any thoughts on this problem are welcome...
520 Apparently there are some problems with ``XView'' programs getting confused
521 and thinking that the screensaver window is the real root window even when
522 the screensaver is not active: ClientMessages intended for the window manager
523 are sent to the screensaver window instead. This could be solved by making
524 xscreensaver forward all unrecognised ClientMessages to the real root window,
525 but there may be other problems as well.
527 When using the \fBMIT-SCREEN-SAVER\fP extension in conjunction with
528 the \fBfade\fP option, you may notice an unattractive flicker just before
529 the fade begins. This is because the server maps a black window just before
530 it tells the \fIxscreensaver\fP process to activate. The \fIxscreensaver\fP
531 process immediately unmaps that window, but this results in a flicker. I
532 haven't figured out how to get around this yet.
534 There need to be a lot more graphics hacks. In particular, there should be
535 a simulation of a Lavalite (tm).
537 Copyright \(co 1992, 1993, 1994, 1995 by Jamie Zawinski. Permission to use,
538 copy, modify, distribute, and sell this software and its documentation for
539 any purpose is hereby granted without fee, provided that the above copyright
540 notice appear in all copies and that both that copyright notice and this
541 permission notice appear in supporting documentation. No representations are
542 made about the suitability of this software for any purpose. It is provided
543 "as is" without express or implied warranty.
545 Jamie Zawinski <jwz@netscape.com>, 13-aug-92.
546 Please let me know if you find any bugs or make any improvements.
548 Thanks to David Wojtowicz for implementing \fIlockTimeout\fP.
550 Thanks to Martin Kraemer for adding support for shadow passwords and
551 locking-disabled diagnostics.