14 .TH XScreenSaver 1 "19-Mar-2001 (3.30)" "X Version 11"
16 xscreensaver - graphics hack and screen locker, launched when the user is idle
19 [\-display \fIhost:display.screen\fP] \
20 [\-timeout \fIint\fP] \
24 [\-lock\-timeout \fIint\fP] \
25 [\-visual \fIvisual\fP] \
32 [\-no\-capture\-stderr] \
37 [\-no\-mit\-extension] \
39 [\-no\-sgi\-extension] \
40 [\-xidle\-extension] \
41 [\-no\-xidle\-extension] \
42 [\-proc\-interrupts] \
43 [\-no\-proc\-interrupts] \
44 [\-xrm \fIresources\fP]
46 The \fIxscreensaver\fP program waits until the keyboard and mouse have been
47 idle for a period, and then runs a graphics demo chosen at random. It
48 turns off as soon as there is any mouse or keyboard activity.
50 This program can lock your terminal in order to prevent others from using it,
51 though its default mode of operation is merely to display pretty pictures on
52 your screen when it is not in use.
54 The benefit that this program has over the combination of the
58 programs is the ease with which new graphics hacks can be installed. You
59 don't need to recompile (or even re-run) this program to add a new display
62 For the impatient, try this:
68 .BR xscreensaver-demo (1)
69 program should pop up a dialog box that lets you experiment with the
70 xscreensaver settings and graphics modes.
75 xscreensaver has a client-server model: the \fIxscreensaver\fP program is a
76 daemon that runs in the background; it is controlled by the foreground
77 .BR xscreensaver-demo (1)
79 .BR xscreensaver-command (1)
82 The easiest way to configure \fIxscreensaver\fP is to simply run the
83 .BR xscreensaver-demo (1)
84 program, and change the settings through the GUI. The rest of this
85 manual page describes lower level ways of changing settings.
87 Options to \fIxscreensaver\fP are stored in one of two places: in
88 a \fI.xscreensaver\fP file in your home directory; or in the X resource
89 database. If the \fI.xscreensaver\fP file exists, it overrides any settings
90 in the resource database.
92 The syntax of the \fI.xscreensaver\fP file is similar to that of
93 the \fI.Xdefaults\fP file; for example, to set the \fItimeout\fP paramter
94 in the \fI.xscreensaver\fP file, you would write the following:
98 whereas, in the \fI.Xdefaults\fP file, you would write
100 xscreensaver.timeout: 5
102 If you change a setting in the \fI.xscreensaver\fP file while xscreensaver
103 is already running, it will notice this, and reload the file. (The file will
104 be reloaded the next time the screen saver needs to take some action, such as
105 blanking or unblanking the screen, or picking a new graphics mode.)
107 If you change a setting in your X resource database, or if you want
108 xscreensaver to notice your changes immediately instead of the next time
109 it wakes up, then you will need to tell the running xscreensaver process
110 to re-initialize itself, like so:
112 xscreensaver-command -restart
114 Note that if you changed the \fI.Xdefaults\fP file, you might also need to run
119 If you want to set the system-wide defaults, then make your edits to
120 the xscreensaver app-defaults file, which should have been installed
121 when xscreensaver itself was installed. The app-defaults file will
122 usually be named /usr/lib/X11/app-defaults/XScreenSaver, but different
123 systems might keep it in a different place (for example,
124 /usr/openwin/lib/app-defaults/XScreenSaver on Solaris.)
126 When settings are changed in the Preferences dialog box (see above)
127 the current settings will be written to the \fI.xscreensaver\fP file.
128 (The \fI.Xdefaults\fP file and the app-defaults file will never be
129 written by xscreensaver itself.)
132 .B timeout\fP (class \fBTime\fP)
133 The screensaver will activate (blank the screen) after the keyboard and
134 mouse have been idle for this many minutes. Default 10 minutes.
136 .B cycle\fP (class \fBTime\fP)
137 After the screensaver has been running for this many minutes, the currently
138 running graphics-hack sub-process will be killed (with \fBSIGTERM\fP), and a
139 new one started. If this is 0, then the graphics hack will never be changed:
140 only one demo will run until the screensaver is deactivated by user activity.
143 .B lock\fP (class \fBBoolean\fP)
144 Enable locking: before the screensaver will turn off, it will require you
145 to type the password of the logged-in user (really, the person who ran
146 xscreensaver), or the root password. (\fBNote:\fP this doesn't work if the
147 screensaver is launched by
149 because it can't know the user-id of the logged-in user. See
150 the ``\fIUsing XDM(1)\fP'' section, below.
152 .B lockTimeout\fP (class \fBTime\fP)
153 If locking is enabled, this controls the length of the ``grace period''
154 between when the screensaver activates, and when the screen becomes locked.
155 For example, if this is 5, and \fI\-timeout\fP is 10, then after 10 minutes,
156 the screen would blank. If there was user activity at 12 minutes, no password
157 would be required to un-blank the screen. But, if there was user activity
158 at 15 minutes or later (that is, \fI\-lock\-timeout\fP minutes after
159 activation) then a password would be required. The default is 0, meaning
160 that if locking is enabled, then a password will be required as soon as the
163 .B passwdTimeout\fP (class \fBTime\fP)
164 If the screen is locked, then this is how many seconds the password dialog box
165 should be left on the screen before giving up (default 30 seconds.) This
166 should not be too large: the X server is grabbed for the duration that the
167 password dialog box is up (for security purposes) and leaving the server
168 grabbed for too long can cause problems.
170 .B visualID\fP (class \fBVisualID\fP)
171 Specify which X visual to use by default. (Note carefully that this resource
172 is called \fBvisualID\fP, not merely \fBvisual\fP; if you set the \fBvisual\fP
173 resource instead, things will malfunction in obscure ways for obscure reasons.)
175 Legal values for the \fBVisualID\fP resource are:
179 Use the screen's default visual (the visual of the root window.)
183 Use the visual which supports the most colors. Note, however, that the
184 visual with the most colors might be a TrueColor visual, which does not
185 support colormap animation. Some programs have more interesting behavior
186 when run on PseudoColor visuals than on TrueColor.
189 Use a monochrome visual, if there is one.
192 Use a grayscale or staticgray visual, if there is one and it has more than
193 one plane (that is, it's not monochrome.)
196 Use the best of the color visuals, if there are any.
199 Use the visual that is best for OpenGL programs. (OpenGL programs have
200 somewhat different requirements than other X programs.)
203 where \fIclass\fP is one of \fBStaticGray\fP, \fBStaticColor\fP,
204 \fBTrueColor\fP, \fBGrayScale\fP, \fBPseudoColor\fP, or \fBDirectColor\fP.
205 Selects the deepest visual of the given class.
208 where \fInumber\fP (decimal or hex) is interpreted as a visual id number,
211 program; in this way you can have finer control over exactly which visual
212 gets used, for example, to select a shallower one than would otherwise
217 Note that this option specifies only the \fIdefault\fP visual that will
218 be used: the visual used may be overridden on a program-by-program basis.
219 See the description of the \fBprograms\fP resource, below.
222 .B installColormap\fP (class \fBBoolean\fP)
223 Install a private colormap while the screensaver is active, so that the
224 graphics hacks can get as many colors as possible. This is the
225 default. (This only applies when the screen's default visual is being
226 used, since non-default visuals get their own colormaps automatically.)
227 This can also be overridden on a per-hack basis: see the discussion of
228 the \fBdefault\-n\fP name in the section about the \fBprograms\fP resource.
230 .B verbose\fP (class \fBBoolean\fP)
231 Whether to print diagnostics. Default false.
233 .B timestamp\fP (class \fBBoolean\fP)
234 Whether to print the time of day along with any other diagnostic messages.
237 .B splash\fP (class \fBBoolean\fP)
238 Whether to display a splash screen at startup. Default true.
240 .B splashDuration\fP (class \fBTime\fP)
241 How long the splash screen should remain visible; default 5 seconds.
243 .B helpURL\fP (class \fBURL\fP)
244 The splash screen has a \fIHelp\fP button on it. When you press it, it will
245 display the web page indicated here in your web browser.
247 .B loadURL\fP (class \fBLoadURL\fP)
248 This is the shell command used to load a URL into your web browser.
249 The default setting will load it into Netscape if it is already running,
250 otherwise, will launch a new Netscape looking at the \fIhelpURL\fP.
252 .B demoCommand\fP (class \fBDemoCommand\fP)
253 This is the shell command run when the \fIDemo\fP button on the splash window
254 is pressed. It defaults to \fIxscreensaver\-demo\fP.
256 .B prefsCommand\fP (class \fBPrefsCommand\fP)
257 This is the shell command run when the \fIPrefs\fP button on the splash window
258 is pressed. It defaults to \fIxscreensaver\-demo\ \-prefs\fP.
260 .B nice\fP (class \fBNice\fP)
261 The sub-processes created by \fIxscreensaver\fP will be ``niced'' to this
262 level, so that they are given lower priority than other processes on the
263 system, and don't increase the load unnecessarily. The default is 10.
265 (Higher numbers mean lower priority; see
269 .B fade\fP (class \fBBoolean\fP)
270 If this is true, then when the screensaver activates, the current contents
271 of the screen will fade to black instead of simply winking out. This only
272 works on displays with writable colormaps, that is, if the screen's default
273 visual is a PseudoColor visual. A fade will also be done when
274 switching graphics hacks (when the \fIcycle\fP timer expires.)
277 .B unfade\fP (class \fBBoolean\fP)
278 If this is true, then when the screensaver deactivates, the original contents
279 of the screen will fade in from black instead of appearing immediately. This
280 only works on displays with writable colormaps, and if \fIfade\fP is true
281 as well. Default false.
283 .B fadeSeconds\fP (class \fBTime\fP)
284 If \fIfade\fP is true, this is how long the fade will be in
285 seconds (default 3 seconds.)
287 .B fadeTicks\fP (class \fBInteger\fP)
288 If \fIfade\fP is true, this is how many times a second the colormap will
289 be changed to effect a fade. Higher numbers yield smoother fades, but
290 may make the fades take longer than the specified \fIfadeSeconds\fP if
291 your server isn't fast enough to keep up. Default 20.
293 .B captureStderr\fP (class \fBBoolean\fP)
294 Whether \fIxscreensaver\fP should redirect its stdout and stderr streams to
295 the window itself. Since its nature is to take over the screen, you would not
296 normally see error messages generated by xscreensaver or the sub-programs it
297 runs; this resource will cause the output of all relevant programs to be
298 drawn on the screensaver window itself, as well as being written to the
299 controlling terminal of the screensaver driver process. Default true.
301 .B font\fP (class \fBFont\fP)
302 The font used for the stdout/stderr text, if \fBcaptureStderr\fP is true.
303 Default \fB*\-medium\-r\-*\-140\-*\-m\-*\fP (a 14 point fixed-width font.)
305 .B programs\fP (class \fBPrograms\fP)
306 The graphics hacks which \fIxscreensaver\fP runs when the user is idle.
307 The value of this resource is a string, one \fIsh\fP-syntax command per line.
308 Each line must contain exactly one command: no semicolons, no ampersands.
310 When the screensaver starts up, one of these is selected at random, and
311 run. After the \fIcycle\fP period expires, it is killed, and another
314 If the value of this resource is empty, then no programs will be run; the
315 screen will simply be made black.
317 If the display has multiple screens, then a different program will be run
318 for each screen. (All screens are blanked and unblanked simultaniously.)
320 Note that you must escape the newlines; here is an example of how you
321 might set this in your \fI~/.xscreensaver\fP file:
327 ico -r -faces -sleep 1 -obj ico \\n\\
328 xdaliclock -builtin2 -root \\n\\
329 xv -root -rmode 5 image.gif -quit \\n
333 Make sure your \fB$PATH\fP environment variable is set up correctly
334 \fIbefore\fP xscreensaver is launched, or it won't be able to find the
335 programs listed in the \fIprograms\fP resource.
337 To use a program as a screensaver, two things are required: that that
338 program draw on the root window (or be able to be configured to draw on
339 the root window); and that that program understand ``virtual root''
340 windows, as used by virtual window managers such as
342 (Generally, this is accomplished by just including the \fI"vroot.h"\fP
343 header file in the program's source.)
345 If there are some programs that you want to run only when using a color
346 display, and others that you want to run only when using a monochrome
347 display, you can specify that like this:
349 mono: mono-program -root \\n\\
350 color: color-program -root \\n\\
354 More generally, you can specify the kind of visual that should be used for
355 the window on which the program will be drawing. For example, if one
356 program works best if it has a colormap, but another works best if it has
357 a 24-bit visual, both can be accommodated:
359 PseudoColor: cmap-program -root \\n\\
360 TrueColor: 24bit-program -root \\n\\
364 In addition to the symbolic visual names described above (in the discussion
365 of the \fIvisualID\fP resource) one other visual name is supported in
366 the \fIprograms\fP list:
370 This is like \fBdefault\fP, but also requests the use of the default colormap,
371 instead of a private colormap. (That is, it behaves as if
372 the \fI\-no\-install\fP command-line option was specified, but only for
373 this particular hack.) This is provided because some third-party programs
374 that draw on the root window (notably:
378 make assumptions about the visual and colormap of the root window:
379 assumptions which xscreensaver can violate.
382 If you specify a particular visual for a program, and that visual does not
383 exist on the screen, then that program will not be chosen to run. This
384 means that on displays with multiple screens of different depths, you can
385 arrange for appropriate hacks to be run on each. For example, if one screen
386 is color and the other is monochrome, hacks that look good in mono can be
387 run on one, and hacks that only look good in color will show up on the other.
391 Normally you won't need to change the following resources:
394 .B pointerPollTime\fP (class \fBTime\fP)
395 When server extensions are not in use, this controls how
396 frequently \fIxscreensaver\fP checks to see if the mouse position or buttons
397 have changed. Default 5 seconds.
399 .B windowCreationTimeout\fP (class \fBTime\fP)
400 When server extensions are not in use, this controls the delay between when
401 windows are created and when \fIxscreensaver\fP selects events on them.
404 .B initialDelay\fP (class \fBTime\fP)
405 When server extensions are not in use, \fIxscreensaver\fP will wait this many
406 seconds before selecting events on existing windows, under the assumption that
407 \fIxscreensaver\fP is started during your login procedure, and the window
408 state may be in flux. Default 0. (This used to default to 30, but that was
409 back in the days when slow machines and X terminals were more common...)
411 .B sgiSaverExtension\fP (class \fBBoolean\fP)
412 There are a number of different X server extensions which can make
413 xscreensaver's job easier. The next few resources specify whether these
414 extensions should be utilized if they are available.
416 This resource controls whether the SGI \fBSCREEN_SAVER\fP server extension
417 will be used to decide whether the user is idle. This is the default
418 if \fIxscreensaver\fP has been compiled with support for this
419 extension (which is the default on SGI systems.). If it is available,
420 the \fBSCREEN_SAVER\fP method is faster and more reliable than what will
421 be done otherwise, so use it if you can. (This extension is only available
422 on Silicon Graphics systems, unfortunately.)
424 .B mitSaverExtension\fP (class \fBBoolean\fP)
425 This resource controls whether the \fBMIT\-SCREEN\-SAVER\fP server extension
426 will be used to decide whether the user is idle. However, the default for
427 this resource is \fIfalse\fP, because even if this extension is available,
428 it is flaky (and it also makes the \fBfade\fP option not work properly.)
429 Use of this extension is not recommended.
431 .B xidleExtension\fP (class \fBBoolean\fP)
432 This resource controls whether the \fBXIDLE\fP server extension will be
433 used to decide whether the user is idle. This is the default
434 if \fIxscreensaver\fP has been compiled with support for this extension.
435 (This extension is only available for X11R4 and X11R5 systems, unfortunately.)
437 .B procInterrupts\fP (class \fBBoolean\fP)
438 This resource controls whether the \fB/proc/interrupts\fP file should be
439 consulted to decide whether the user is idle. This is the default
440 if \fIxscreensaver\fP has been compiled on a system which supports this
441 mechanism (i.e., Linux systems.)
443 The benefit to doing this is that \fIxscreensaver\fP can note that the user
444 is active even when the X console is not the active one: if the user is
445 typing in another virtual console, xscreensaver will notice that and will
446 fail to activate. For example, if you're playing Quake in VGA-mode,
447 xscreensaver won't wake up in the middle of your game and start competing
450 The drawback to doing this is that perhaps you \fIreally do\fP want idleness
451 on the X console to cause the X display to lock, even if there is activity
452 on other virtual consoles. If you want that, then set this option to False.
453 (Or just lock the X console manually.)
455 The default value for this resource is True, on systems where it works.
457 .B overlayStderr\fP (class \fBBoolean\fP)
458 If \fBcaptureStderr\fP is True, and your server supports ``overlay'' visuals,
459 then the text will be written into one of the higher layers instead of into
460 the same layer as the running screenhack. Set this to False to disable
461 that (though you shouldn't need to.)
463 .B overlayTextForeground\fP (class \fBForeground\fP)
464 The foreground color used for the stdout/stderr text, if \fBcaptureStderr\fP
465 is true. Default: Yellow.
467 .B overlayTextBackground\fP (class \fBBackground\fP)
468 The background color used for the stdout/stderr text, if \fBcaptureStderr\fP
469 is true. Default: Black.
471 .B bourneShell\fP (class \fBBourneShell\fP)
472 The pathname of the shell that \fIxscreensaver\fP uses to start subprocesses.
473 This must be whatever your local variant of \fB/bin/sh\fP is: in particular,
474 it must not be \fBcsh\fP.
475 .SH COMMAND-LINE OPTIONS
477 also accepts the following command line options. Except for
478 the \fI\-display\fP option, these command-line options are all
479 simply shorthand for the X resources described in
480 the \fIConfiguration\fP section, above.
482 .B \-display \fIhost:display.screen\fP
483 The X display to use. For displays with multiple screens, XScreenSaver
484 will manage all screens on the display simultaniously; the \fIscreen\fP
485 argument (the ``default'' screen) says which screen should be used for
486 dialog boxes (the password window, \fIDemo Mode\fP, etc.)
488 .B \-timeout \fIminutes\fP
489 Same as the \fItimeout\fP resource.
491 .B \-cycle \fIminutes\fP
492 Same as the \fIcycle\fP resource.
495 Same as setting the \fIlock\fP resource to \fItrue\fP.
498 Same as setting the \fIlock\fP resource to \fIfalse\fP.
500 .B \-lock\-timeout \fIminutes\fP
501 Same as the \fIlockTimeout\fP resource.
503 .B \-visual \fIvisual\fP
504 Same as the \fIvisualID\fP resource.
507 Same as setting the \fIinstallColormap\fP resource to \fItrue\fP.
510 Same as setting the \fIinstallColormap\fP resource to \fIfalse\fP.
513 Same as setting the \fIverbose\fP resource to \fItrue\fP.
516 Same as setting the \fIverbose\fP resource to \fIfalse\fP.
519 Same as setting the \fItimestamp\fP resource to \fItrue\fP.
522 Same as setting the \fIcaptureStderr\fP resource to \fItrue\fP.
524 .B \-no\-capture\-stderr
525 Same as setting the \fIcaptureStderr\fP resource to \fIfalse\fP.
528 Same as setting the \fIsplash\fP resource to \fItrue\fP.
531 Same as setting the \fIsplash\fP resource to \fIfalse\fP.
533 .B \-nice \fIinteger\fP
534 Same as the \fInice\fP resource.
537 Same as setting the \fIsgiSaverExtension\fP resource to \fItrue\fP.
539 .B \-no\-sgi\-extension
540 Same as setting the \fIsgiSaverExtension\fP resource to \fIfalse\fP.
543 Same as setting the \fImitSaverExtension\fP resource to \fItrue\fP.
545 .B \-no\-mit\-extension
546 Same as setting the \fImitSaverExtension\fP resource to \fIfalse\fP.
548 .B \-xidle\-extension
549 Same as setting the \fIxidleExtension\fP resource to \fItrue\fP.
551 .B \-no\-xidle\-extension
552 Same as setting the \fIxidleExtension\fP resource to \fIfalse\fP.
554 .B \-proc\-interrupts
555 Same as setting the \fIprocInterrupts\fP resource to \fItrue\fP.
557 .B \-no\-proc\-interrupts
558 Same as setting the \fIprocInterrupts\fP resource to \fIfalse\fP.
560 .B \-xrm \fIresource-specification\fP
561 As with all other Xt programs, you can specify X resources on the command-line
562 using the \fI\-xrm\fP argument. Most of the interesting resources have
563 command-line equivalents, however.
565 When it is time to activate the screensaver, a full-screen black window is
566 created on each screen of the display. Each window is created in such a way
567 that, to any subsequently-created programs, it will appear to be a ``virtual
568 root'' window. Because of this, any program which draws on the root
569 window (and which understands virtual roots) can be used as a screensaver.
571 When the user becomes active again, the screensaver windows are unmapped, and
572 the running subprocesses are killed by sending them \fBSIGTERM\fP. This is
573 also how the subprocesses are killed when the screensaver decides that it's
574 time to run a different demo: the old one is killed and a new one is launched.
576 Before launching a subprocess, \fIxscreensaver\fP stores an appropriate value
577 for \fB$DISPLAY\fP in the environment that the child will receive. (This is
578 so that if you start \fIxscreensaver\fP with a \fI-display\fP argument, the
579 programs which \fIxscreensaver\fP launches will draw on the same display;
580 and so that the child will end up drawing on the appropriate screen of a
581 multi-headed display.)
583 When the screensaver turns off, or is killed, care is taken to restore
584 the ``real'' virtual root window if there is one. Because of this, it is
585 important that you not kill the screensaver process with \fIkill -9\fP if
586 you are running a virtual-root window manager. If you kill it with \-9,
587 you may need to restart your window manager to repair the damage. This
588 isn't an issue if you aren't running a virtual-root window manager.
590 For all the gory details, see the commentary at the top of xscreensaver.c.
592 You can control a running screensaver process by using the
593 .BR xscreensaver\-command (1)
596 Modern X servers contain support to power down the monitor after an idle
597 period. If the monitor has powered down, then \fIxscreensaver\fP will
598 notice this (after a few minutes), and will not waste CPU by drawing
599 graphics demos on a black screen. An attempt will also be made to
600 explicitly power the monitor back up as soon as user activity is detected.
602 If your X server supports power management, then
604 will accept a \fBdpms\fP option. So, if you wanted \fIxscreensaver\fP
605 to activate after 5 minutes, but you wanted your monitor to power down
606 after one hour (3600 seconds) you would do this:
610 See the man page for the
612 program for details. (Note that power management requires both software
613 support in the X server, and hardware support in the monitor itself.)
615 You can run \fIxscreensaver\fP from your
617 session, so that the screensaver will run even when nobody is logged
620 The trick to using xscreensaver with \fIxdm\fP is this: keep in mind the
621 two very different states in which xscreensaver will be running:
624 .B 1: Nobody logged in.
626 If you're thinking of running xscreensaver from XDM at all, then it's
627 probably because you want graphics demos to be running on the console
628 when nobody is logged in there. In this case, xscreensaver will function
629 only as a screen saver, not a screen locker: it doesn't make sense
630 for xscreensaver to lock the screen, since nobody is logged in yet!
631 The only thing on the screen is the XDM login prompt.
633 .B 2: Somebody logged in.
635 Once someone has logged in through the XDM login window, the situation is
636 very different. For example: now it makes sense to lock the screen (and
637 prompt for the logged in user's password); and now xscreensaver should
638 consult that user's \fI~/.xscreensaver\fP file; and so on.
641 The difference between these two states comes down to a question of,
642 which user is the \fIxscreensaver\fP process running as? For the first
643 state, it doesn't matter. If you start \fIxscreensaver\fP in the usual
644 XDM way, then xscreensaver will probably end up running as root, which
645 is fine for the first case (the ``nobody logged in'' case.)
647 However, once someone is logged in, running as root is no longer fine:
648 because xscreensaver will be consulting root's \fI.xscreensaver\fP file
649 instead of that of the logged in user, and won't be prompting for the
650 logged in user's password, and so on. (This is not a security problem,
651 it's just not what you want.)
653 So, once someone has logged in, you want xscreensaver to be running as that
654 user. The way to accomplish this is to kill the old xscreensaver process
655 and start a new one (as the new user.)
657 The simplest way to accomplish all of this is as follows:
660 .B 1: Launch xscreensaver before anyone logs in.
662 To the file \fI/usr/lib/X11/xdm/Xsetup\fP, add the lines
665 xscreensaver-command -exit
668 This will run xscreensaver as root, over the XDM login window.
669 Moving the mouse will cause the screen to un-blank, and allow the user
670 to type their password at XDM to log in.
672 .B 2: Restart xscreensaver when someone logs in.
674 Near the top of the file \fI/usr/lib/X11/xdm/Xsession\fP, add those same lines:
676 xscreensaver-command -exit
679 When someone logs in, this will kill off the existing (root) xscreensaver
680 process, and start a new one, running as the user who has just logged in.
681 If the user's .xscreensaver file requests locking, they'll get it. They
682 will also get their own choice of timeouts, and graphics demos, and so on.
684 Alternately, each user could just put those lines in their
685 personal \fI~/.xsession\fP files.
688 Make sure you have \fB$PATH\fP set up correctly in the \fIXsetup\fP
689 and \fIXsession\fP scripts, or \fIxdm\fP won't be able to
690 find \fIxscreensaver\fP, and/or \fIxscreensaver\fP won't be able to
691 find its graphics demos.
693 (If your system does not seem to be executing the \fIXsetup\fP file, you
694 may need to configure it to do so: the traditional way to do this is
695 to make that file the value of the \fIDisplayManager*setup\fP resource
696 in the \fI/usr/lib/X11/xdm/xdm-config\fP file. See the man page for
700 It is safe to run \fIxscreensaver\fP as root (as \fIxdm\fP is likely to do.)
701 If run as root, \fIxscreensaver\fP changes its effective user and group ids
702 to something safe (like \fI"nobody"\fP) before connecting to the X server
703 or launching user-specified programs.
705 An unfortunate side effect of this (important) security precaution is that
706 it may conflict with cookie-based authentication.
708 If you get "connection refused" errors when running \fIxscreensaver\fP
709 from \fIxdm\fP, then this probably means that you have
711 or some other security mechanism turned on. One way around this is to
712 add \fB"xhost\ +localhost"\fP to \fIXsetup\fP, just before \fIxscreensaver\fP
715 Note that this will give access to the X server to anyone capable of logging
716 in to the local machine, so in some environments, this might not be
717 appropriate. If turning off file-system-based access control is not
718 acceptable, then running \fIxscreensaver\fP from the \fIXsetup\fP file
719 might not be possible, and xscreensaver will only work when running as
720 a normal, unprivileged user.
722 For more information on the X server's access control mechanisms, see the
730 The instructions for using \fIxscreensaver\fP with
732 are almost the same as for using
734 above. There are only two differences, really: instead
735 of editing \fI/usr/lib/X11/xdm/Xsetup\fP, edit the
736 file \fI/etc/X11/gdm/Init/Default\fP; and instead of
737 editing \fI/usr/lib/X11/xdm/Xsession\fP, edit one or all of the
738 files in the \fI/etc/X11/gdm/Sessions/\fP directory. (Note that
739 the default session (\fI/etc/X11/gdm/Sessions/Default\fP) usually
740 simply executes \fI/usr/lib/X11/xdm/Xsession\fP, so be careful
741 you aren't initializing xscreensaver twice.)
743 All the same caveats apply for
747 .SH USING CDE (COMMON DESKTOP ENVIRONMENT)
748 The easiest way to use \fIxscreensaver\fP on a system with CDE is to simply
749 switch off the built-in CDE screensaver, and use \fIxscreensaver\fP instead;
750 and second, to tell the front panel to run
751 .BR xscreensaver\-command (1)
752 with the \fI\-lock\fP option when the \fILock\fP icon is clicked.
754 To accomplish this involves five steps:
757 \fB1: Switch off CDE's locker\fP
758 Do this by turning off ``\fIScreen Saver and Screen Lock\fP'' in the
759 Screen section of the Style Manager.
761 \fB2: Edit sessionetc\fP
762 Edit the file \fI~/.dt/sessions/sessionetc\fP and add to it the line
766 This will cause \fIxscreensaver\fP to be launched when you log in.
767 (As always, make sure that xscreensaver and the graphics demos are on
768 your \fB$PATH\fP; the path needs to be set in \fI.cshrc\fP
769 and/or \fI.dtprofile\fP, not \fI.login\fP.)
771 \fB3: Create XScreenSaver.dt\fP
772 Create a file called \fI~/.dt/types/XScreenSaver.dt\fP with the following
779 EXEC_STRING xscreensaver-command -lock
784 This defines a ``lock'' command for the CDE front panel, that knows how
785 to talk to \fIxscreensaver\fP.
787 \fB4: Create Lock.fp\fP
788 Create a file called \fI~/.dt/types/Lock.fp\fP with the following
794 CONTAINER_NAME Switch
795 CONTAINER_TYPE SWITCH
799 PUSH_ACTION XScreenSaver
800 HELP_TOPIC FPOnItemLock
804 This associates the CDE front panel ``Lock'' icon with the lock command
805 we just defined in step 3.
808 Select ``\fIRestart Workspace Manager\fP'' from the popup menu to make
809 your changes take effect. If things seem not to be working, check the
810 file \fI~/.dt/errorlog\fP for error messages.
812 .SH USING HP VUE (VISUAL USER ENVIRONMENT)
813 Since CDE is a descendant of VUE, the instructions for using xscreensaver
814 under VUE are similar to the above:
817 \fB1: Switch off VUE's locker\fP
818 Open the ``\fIStyle Manager\fP'' and select ``\fIScreen\fP.''
819 Turn off ``\fIScreen Saver and Screen Lock\fP'' option.
821 \fB2: Make sure you have a Session\fP
822 Next, go to the Style Manager's, ``\fIStartup\fP'' page.
823 Click on ``\fISet Home Session\fP'' to create a session, then
824 on ``\fIReturn to Home Session\fP'' to select this session each
827 \fB3: Edit vue.session\fP
828 Edit the file \fI~/.vue/sessions/home/vue.session\fP and add to it
831 vuesmcmd -screen 0 -cmd "xscreensaver"
833 This will cause \fIxscreensaver\fP to be launched when you log in.
834 (As always, make sure that xscreensaver and the graphics demos are on
835 your \fB$PATH\fP; the path needs to be set in \fI.cshrc\fP
836 and/or \fI.profile\fP, not \fI.login\fP.)
838 \fB3: Edit vuewmrc\fP
839 Edit the file \fI~/.vue/vuewmrc\fP and add (or change) the Lock control:
845 PUSH_ACTION f.exec "xscreensaver-command -lock"
849 This associates the VUE front panel ``Lock'' icon with the xscreensaver
855 .BR xscreensaver-command (1)
856 program is a perfect candidate for something to add to your window manager's
857 popup menus. If you use
861 or (probably) any of \fItwm\fP's many descendants, you can do it like this:
864 \fB1. Create ~/.mwmrc (or ~/.twmrc or ...)\fP
865 If you don't have a \fI~/.mwmrc\fP file (or, on SGIs, a \fI~/.4Dwmrc\fP file;
866 or, with twm, a \fI~/.twmrc\fP file) then create one by making a copy of
867 the \fI/usr/lib/X11/system.mwmrc\fP
868 file (or \fI/usr/lib/X11/twm/system.twmrc\fP, and so on.)
870 \fB2. Add a menu definition.\fP
875 "Blank Screen Now" !"sleep 3; xscreensaver-command -activate"
876 "Lock Screen Now" !"sleep 3; xscreensaver-command -lock"
877 "Screen Saver Demo" !"xscreensaver-demo"
878 "Screen Saver Preferences" !"xscreensaver-demo -prefs"
879 "Reinitialize Screen Saver" !"xscreensaver-command -restart"
880 "Kill Screen Saver" !"xscreensaver-command -exit"
881 "Launch Screen Saver" !"xscreensaver &"
885 \fB3. Add the menu\fP
890 find the section of the file that says \fIMenu DefaultRootMenu\fP.
893 it will probably be \fImenu "defops"\fP. If you add a line somewhere
894 in that menu definition that reads
896 "XScreenSaver" f.menu XScreenSaver
898 then this will add an XScreenSaver sub-menu to your default root-window
899 popup menu. Alternately, you could just put the xscreensaver menu items
900 directly into the root menu.
903 For Fvwm2, the process is similar: first create a \fI~/.fvwm2rc\fP file
904 if you don't already have one, by making a copy of
905 the \fI/etc/X11/fvwm2/system.fvwm2rc\fP file. Then, add a menu definition
908 AddToMenu XScreenSaver "XScreenSaver" Title
909 + "Blank Screen Now" Exec xscreensaver-command -activate
910 + "Lock Screen Now" Exec xscreensaver-command -lock
911 + "Screen Saver Demo" Exec xscreensaver-command -demo
912 + "Screen Saver Preferences" Exec xscreensaver-command -prefs
913 + "Reinitialize Screen Saver" Exec xscreensaver-command -restart
914 + "Kill Screen Saver" Exec xscreensaver-command -exit
915 + "Launch Screen Saver" Exec xscreensaver
916 + "Run Next Demo" Exec xscreensaver-command -next
917 + "Run Previous Demo" Exec xscreensaver-command -prev
919 # To put the XScreenSaver sub-menu at the end of the root menu:
920 AddToMenu RootMenu "XScreenSaver" Popup XScreenSaver
922 The Enlightenment window manager keeps each of its menus in a separate
923 file. So, you need to create a file
924 named \fI~/.enlightenment/xscreensaver.menu\fP with the contents:
926 "XScreenSaver Commands"
927 "Blank Screen Now" NULL exec "xscreensaver-command -activate"
928 "Lock Screen Now" NULL exec "xscreensaver-command -lock"
929 "Screen Saver Demo" NULL exec "xscreensaver-command -demo"
930 "Screen Saver Prefs" NULL exec "xscreensaver-command -prefs"
931 "Reinitialize Saver" NULL exec "xscreensaver-command -restart"
932 "Kill Screen Saver" NULL exec "xscreensaver-command -exit"
933 "Launch Screen Saver" NULL exec "xscreensaver"
937 "XScreenSaver" NULL menu "xscreensaver.menu"
939 to \fI~/.enlightenment/file.menu\fP to put the XScreenSaver submenu on
940 your left-button root-window menu.
942 As you see, every window manager does this stuff gratuitously differently,
943 just to make your life difficult. You are in a maze of twisty menu
944 configuration languages, all alike.
946 Bugs? There are no bugs. Ok, well, maybe. If you find one, please let
947 me know. http://www.jwz.org/xscreensaver/bugs.html explains how to
948 construct the most useful bug reports.
951 If xscreensaver has been launched from
953 before anyone has logged in, you will need to kill and then restart the
954 xscreensaver daemon after you have logged in, or you will be confused by
955 the results. (For example, locking won't work, and your \fI~/.xscreensaver\fP
956 file will be ignored.)
958 When you are logged in, you want the \fIxscreensaver\fP daemon to be
959 running under \fIyour\fP user id, not as root or some other user.
961 If it has already been started by \fIxdm\fP, you can kill it by sending
962 it the \fBexit\fP command, and then re-launching it as you, by putting
963 something like the following in your personal X startup script:
965 xscreensaver-command -exit
968 The ``\fIUsing XDM(1)\fP'' section, above, goes into more detail, and explains
969 how to configure the system to do this for all users automatically.
971 .B Locking and root logins
972 In order for it to be safe for xscreensaver to be launched by \fIxdm\fP,
973 certain precautions had to be taken, among them that xscreensaver never
974 runs as \fIroot\fP. In particular, if it is launched as root (as \fIxdm\fP
975 is likely to do), xscreensaver will disavow its privileges, and switch
976 itself to a safe user id (such as \fInobody\fP.)
978 An implication of this is that if you log in as \fIroot\fP on the console,
979 xscreensaver will refuse to lock the screen (because it can't tell
980 the difference between \fIroot\fP being logged in on the console, and a
981 normal user being logged in on the console but xscreensaver having been
987 The solution to this is simple: you shouldn't be logging in on the console
988 as \fIroot\fP in the first place! (What, are you crazy or something?)
990 Proper Unix hygiene dictates that you should log in as yourself, and
992 to \fIroot\fP as necessary. People who spend their day logged in
993 as \fIroot\fP are just begging for disaster.
996 For xscreensaver to work when launched by
998 programs running on the local machine as user \fI"nobody"\fP must be
999 able to connect to the X server. This means that if you want to run
1000 xscreensaver on the console while nobody is logged in, you may need
1001 to disable cookie-based access control (and allow all users who can log
1002 in to the local machine to connect to the display.)
1004 You should be sure that this is an acceptable thing to do in your
1005 environment before doing it. See the ``\fIUsing XDM(1)\fP'' section,
1006 above, for more details.
1008 If anyone has suggestions on how xscreensaver could be made to work with
1010 without first turning off \fI.Xauthority\fP-based access control, please
1014 If you get an error message at startup like ``couldn't get password
1015 of \fIuser\fP'' then this probably means that you're on a system in which
1018 library routine can only be effectively used by root. If this is the case,
1019 then \fIxscreensaver\fP must be installed as setuid to root in order for
1020 locking to work. Care has been taken to make this a safe thing to do.
1022 It also may mean that your system uses shadow passwords instead of the standard
1024 interface; in that case, you may need to change some options
1025 with \fIconfigure\fP and recompile.
1027 If you change your password after xscreensaver has been launched, it will
1028 continue using your old password to unlock the screen until xscreensaver
1029 is restarted. So, after you change your password, you'll have to do
1031 xscreensaver-command -restart
1033 to make \fIxscreensaver\fP notice.
1036 If your system uses PAM (Pluggable Authentication Modules), then in order
1037 for xscreensaver to use PAM properly, PAM must be told about xscreensaver.
1038 The xscreensaver installation process should update the PAM data (on Linux,
1039 by creating the file \fI/etc/pam.d/xscreensaver\fP for you, and on Solaris,
1040 by telling you what lines to add to the \fI/etc/pam.conf\fP file.)
1042 If the PAM configuration files do not know about xscreensaver, then
1043 you \fImight\fP be in a situation where xscreensaver will refuse to ever
1046 This is a design flaw in PAM (there is no way for a client to tell the
1047 difference between PAM responding ``I have never heard of your module,''
1048 and responding, ``you typed the wrong password.'') As far as I can tell,
1049 there is no way for xscreensaver to automatically work around this, or
1050 detect the problem in advance, so if you have PAM, make sure it is
1051 configured correctly!
1053 .B Colormap lossage: TWM
1054 The \fBinstallColormap\fP option doesn't work very well with the
1056 window manager and its descendants.
1058 There is a race condition between the screensaver and this window manager,
1059 which can result in the screensaver's colormap not getting installed
1060 properly, meaning the graphics hacks will appear in essentially random
1061 colors. (If the screen goes white instead of black, this is probably why.)
1067 window managers don't have this problem. The race condition exists
1068 because X (really, ICCCM) does not provide a way for an OverrideRedirect
1069 window to have its own colormap, short of grabbing the server (which is
1070 neither a good idea, nor really possible with the current design.) What
1071 happens is that, as soon as xscreensaver installs its colormap, \fBtwm\fP
1072 responds to the resultant \fBColormapNotify\fP event by re-instaling the
1073 default colormap. Apparently, \fBtwm\fP doesn't \fIalways\fP do this; it
1074 seems to do it regularly if the screensaver is activated from a menu item,
1075 but seems to not do it if the screensaver comes on of its own volition, or
1076 is activated from another console.
1079 .B Attention, window manager authors!
1080 You should only call
1081 .BR XInstallColormap (3)
1082 in response to user events. That is, it is appropriate to install a colormap
1083 in response to \fBFocusIn\fP, \fBFocusOut\fP, \fBEnterNotify\fP,
1084 and \fBLeaveNotify\fP events; but it is not appropriate to call it in
1085 response to \fBColormapNotify\fP events. If you install colormaps in
1086 response to \fIapplication\fP actions as well as in response to \fIuser\fP
1087 actions, then you create the situation where it is impossible for
1088 override-redirect applications (such as xscreensaver) to display their
1089 windows in the proper colors.
1092 .B Colormap lossage: XV, XAnim, XEarth
1093 Some programs don't operate properly on visuals other than the default one,
1094 or with colormaps other than the default one. See the discussion of the
1095 magic "default-n" visual name in the description of the \fBprograms\fP
1096 resource in the \fIConfiguration\fP section. When programs only work with
1097 the default colormap, you need to use a syntax like this:
1099 default-n: xv -root image-1.gif -quit \\n\\
1100 default-n: xearth -nostars -wait 0 \\n\\
1102 It would also work to turn off the \fBinstallColormap\fP option altogether,
1103 but that would deny extra colors to those programs that \fIcan\fP take
1107 Although this program ``nices'' the subprocesses that it starts,
1108 graphics-intensive subprograms can still overload the machine by causing
1109 the X server process itself (which is not ``niced'') to suck a lot of
1110 cycles. Care should be taken to slow down programs intended for use as
1111 screensavers by inserting strategic calls to
1115 (or making liberal use of any \fI\-delay\fP options which the programs
1118 Note that the OpenGL-based graphics demos are real pigs on machines that
1119 don't have texture hardware.
1121 Also, an active screensaver will cause your X server to be pretty much
1122 permanently swapped in; but the same is true of any program that draws
1128 .B Latency and Responsiveness
1129 If the subprocess is drawing too quickly and the connection to the X
1130 server is a slow one (such as an X terminal running over a phone line) then
1131 the screensaver might not turn off right away when the user becomes active
1134 demo has this problem if being run in full-speed mode). This can be
1135 alleviated by inserting strategic calls to
1137 in code intended for use as a screensaver. This prevents too much graphics
1138 activity from being buffered up.
1140 .B XFree86's Magic Keystrokes
1141 The XFree86 X server traps certain magic keystrokes before client programs ever
1142 see them. Two that are of note are Ctrl+Alt+Backspace, which causes
1143 the X server to exit; and Ctrl+Alt+F\fIn\fP, which switches virtual consoles.
1144 The X server will respond to these keystrokes even if xscreensaver has the
1145 screen locked. Depending on your setup, you might consider this a problem.
1147 Unfortunately, there is no way for xscreensaver itself to override the
1148 interpretation of these keys. If you want to disable Ctrl+Alt+Backspace
1149 globally, you need to set the \fIDontZap\fP flag in
1150 your \fI/etc/X11/XF86Config\fP file. See the
1154 There is no way (as far as I can tell) to disable the VT-switching keystrokes.
1156 Some Linux systems come with a VT_LOCKSWITCH ioctl, that one could
1157 theoretically use to prevent VT-switching while the screen is locked;
1158 but unfortunately, this ioctl can only be used by root, which means
1159 that xscreensaver can't use it (since xscreensaver disavows its privileges
1160 shortly after startup, for security reasons.)
1162 Any suggestions for other solutions to this problem are welcome.
1165 Apparently there are some problems with XView programs getting confused
1166 and thinking that the screensaver window is the real root window even when
1167 the screensaver is not active: ClientMessages intended for the window manager
1168 are sent to the screensaver window instead. This could be solved by making
1169 xscreensaver forward all unrecognised ClientMessages to the real root window,
1170 but there may be other problems as well. If anyone has any insight on the
1171 cause of this problem, please let me know. (XView is an X11 toolkit that
1172 implements the (quite abominable) Sun OpenLook look-and-feel.)
1174 .B MIT Extension and Fading
1175 The \fBMIT-SCREEN-SAVER\fP extension is junk. Don't use it.
1177 When using the \fBMIT-SCREEN-SAVER\fP extension in conjunction with
1178 the \fBfade\fP option, you'll notice an unattractive flicker just before
1179 the fade begins. This is because the server maps a black window just before
1180 it tells the \fIxscreensaver\fP process to activate. The \fIxscreensaver\fP
1181 process immediately unmaps that window, but this results in a flicker. I
1182 haven't figured a way to get around this; it seems to be a fundamental
1183 property of the (mis-) design of this server extension.
1185 It sure would be nice if someone would implement the \fBSGI SCREEN_SAVER\fP
1186 extension in XFree86; it's dead simple, and works far better than the
1187 overengineered and broken \fBMIT-SCREEN-SAVER\fP extension.
1190 If you're running Irix 6.3, you might find that your monitor is powering down
1191 after an hour or two even if you've told it not to. This is fixed by SGI
1192 patches 2447 and 2537.
1194 If you're running Irix 6.5, this bug is back. I don't know a fix.
1196 .B MesaGL and Voodoo Cards
1197 If you have a 3Dfx/Voodoo card, the default settings for xscreensaver will
1198 run the GL-based graphics demos in such a way that they will not take
1199 advantage of the 3D acceleration hardware. The solution is to change
1200 the \fBprograms\fP entries for the GL hacks from this:
1206 MESA_GLX_FX=fullscreen gears \\n\\
1208 That is, make sure that \fB$MESA_GLX_FX\fP is set to \fIfullscreen\fP, and
1209 don't tell the program to draw on the root window. This may seem strange,
1210 but the setup used by Mesa and these kinds of cards \fIis\fP strange!
1212 For those who don't know, these cards work by sitting between your normal
1213 video card and the monitor, and seizing control of the monitor when it's
1214 time to do 3D. But this means that accelerated 3D only happens in full-screen
1215 mode (you can't do it in a window, and you can't see the output of 3D and 2D
1216 programs simultaniously), and that 3D will probably drive your monitor at a
1217 lower resolution, as well. It's bizarre.
1219 If you find that GL programs only work properly when run as root, and not
1220 as normal users, then the problem is that your \fI/dev/3dfx\fP file is not
1221 configured properly. Check the Linux 3Dfx FAQ.
1224 If \fIprocInterrupts\fP is on (which is the default on Linux systems) and
1225 you're using some program that toggles the state of your keyboard LEDs,
1226 xscreensaver won't work right: turning those LEDs on or off causes a
1227 keyboard interrupt, which xscreensaver will interpret as user activity.
1228 So if you're using such a program, set the \fIprocInterrupts\fP resource
1232 If you are not making use of one of the server extensions (\fBXIDLE\fP,
1233 \fBSGI SCREEN_SAVER\fP, or \fBMIT-SCREEN-SAVER\fP), then it is possible, in
1234 rare situations, for \fIxscreensaver\fP to interfere with event propagation
1235 and make another X program malfunction. For this to occur, that other
1236 application would need to \fInot\fP select \fBKeyPress\fP events on its
1237 non-leaf windows within the first 30 seconds of their existence, but then
1238 select for them later. In this case, that client \fImight\fP fail to receive
1239 those events. This isn't very likely, since programs generally select a
1240 constant set of events immediately after creating their windows and then
1241 don't change them, but this is the reason that it's a good idea to install
1242 and use one of the server extensions instead, to work around this shortcoming
1245 In all these years, I've not heard of even a single case of this happening,
1246 but it is theoretically possible, so I'm mentioning it for completeness...
1249 There need to be a lot more graphics hacks. In particular, there should be
1250 a simulation of a Lavalite (tm).
1255 to get the default host and display number, and to inform the sub-programs
1256 of the screen on which to draw.
1259 to find the sub-programs to run.
1262 for the directory in which to read and write the \fI.xscreensaver\fP file.
1265 to get the name of a resource file that overrides the global resources
1266 stored in the RESOURCE_MANAGER property.
1268 The latest version can always be found at
1269 http://www.jwz.org/xscreensaver/
1272 .BR xscreensaver\-demo (1),
1273 .BR xscreensaver\-command (1),
1274 .BR xscreensaver\-gl\-helper (1),
1295 .BR decayscreen (1),
1320 .BR interference (1),
1323 .BR kaleidescope (1),
1355 .BR slidescreen (1),
1366 .BR superquadrics (1),
1381 .BR xbouncebits (1),
1393 Copyright \(co 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
1394 by Jamie Zawinski. Permission to use, copy, modify, distribute, and sell
1395 this software and its documentation for any purpose is hereby granted without
1396 fee, provided that the above copyright notice appear in all copies and that
1397 both that copyright notice and this permission notice appear in supporting
1398 documentation. No representations are made about the suitability of this
1399 software for any purpose. It is provided "as is" without express or implied
1402 Jamie Zawinski <jwz@jwz.org>. Written in late 1991; first posted
1403 to comp.sources.x on 13-Aug-1992.
1405 Please let me know if you find any bugs or make any improvements.
1406 .SH ACKNOWLEDGEMENTS
1407 Thanks to Angela Goodman for the XScreenSaver logo.
1409 Thanks to the many people who have contributed graphics demos to the package.
1411 Thanks to David Wojtowicz for implementing \fIlockTimeout\fP.
1413 Thanks to Martin Kraemer for adding support for shadow passwords and
1414 locking-disabled diagnostics.
1416 Thanks to Patrick Moreau for the VMS port.
1418 Thanks to Mark Bowyer for figuring out how to hook it up to CDE.
1420 Thanks to Nat Lanza for the Kerberos support.
1422 Thanks to Bill Nottingham for the initial PAM support.
1424 And thanks to Jon A. Christopher for implementing the Athena dialog
1425 support, back in the days before Lesstif or Gtk were viable alternatives