14 .TH XScreenSaver 1 "24-Oct-98 (3.01)" "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 [\-xrm \fIresources\fP]
44 The \fIxscreensaver\fP program waits until the keyboard and mouse have been
45 idle for a period, and then runs a graphics demo chosen at random. It
46 turns off as soon as there is any mouse or keyboard activity.
48 This program can lock your terminal in order to prevent others from using it,
49 though its default mode of operation is merely to display pretty pictures on
50 your screen when it is not in use.
52 The benefit that this program has over the combination of the
56 programs is the ease with which new graphics hacks can be installed. You
57 don't need to recompile (or even re-run) this program to add a new display
60 For the impatient, try this:
65 The \fIxscreensaver\-demo\fP program should pop up a dialog box
66 that lets you experiment with the xscreensaver settings and graphics
72 xscreensaver has a client-server model: the \fIxscreensaver\fP program is a
73 daemon that runs in the background; it is controlled by the foreground
74 .BR xscreensaver-demo (1)
76 .BR xscreensaver-command (1)
79 Options to \fIxscreensaver\fP are specified in one of two places: in
80 a \fI.xscreensaver\fP file in your home directory; or in the X resource
81 database. If a \fI.xscreensaver\fP file exists, it overrides any settings
82 in the resource database.
84 The syntax of the \fI.xscreensaver\fP file is similar to that of
85 the \fI.Xdefaults\fP file; for example, to set the \fItimeout\fP paramter
86 in the \fI.xscreensaver\fP file, you would write the following:
90 whereas, in the \fI.Xdefaults\fP file, you would write
92 xscreensaver.timeout: 5
94 If you change a setting in the \fI.xscreensaver\fP file while xscreensaver
95 is already running, it will notice this, and reload the file. (The file will
96 be reloaded the next time the screen saver needs to take some action, such as
97 blanking or unblanking the screen, or picking a new graphics mode.)
99 If you change a setting in your X resource database, or if you want
100 xscreensaver to notice your changes immediately instead of the next time
101 it wakes up, then you will need to tell the running xscreensaver process
102 to re-initialize itself, like so:
104 xscreensaver-command -restart
106 Note that if you changed the \fI.Xdefaults\fP file, you might also need to run
111 If you want to set the system-wide defaults, then make your edits to
112 the xscreensaver app-defaults file, which should have been installed
113 when xscreensaver itself was installed. The app-defaults file will
114 usually be named /usr/lib/X11/app-defaults/XScreenSaver, but different
115 systems might keep it in a different place (for example,
116 /usr/openwin/lib/app-defaults/XScreenSaver on Solaris.)
118 When settings are changed in the Preferences dialog box (see above)
119 the current settings will be written to the \fI.xscreensaver\fP file.
120 (The \fI.Xdefaults\fP file and the app-defaults file will never be
121 written by xscreensaver itself.)
124 .B timeout\fP (class \fBTime\fP)
125 The screensaver will activate (blank the screen) after the keyboard and
126 mouse have been idle for this many minutes. Default 10 minutes.
128 .B cycle\fP (class \fBTime\fP)
129 After the screensaver has been running for this many minutes, the currently
130 running graphics-hack sub-process will be killed (with \fBSIGTERM\fP), and a
131 new one started. If this is 0, then the graphics hack will never be changed:
132 only one demo will run until the screensaver is deactivated by user activity.
135 .B lock\fP (class \fBBoolean\fP)
136 Enable locking: before the screensaver will turn off, it will require you
137 to type the password of the logged-in user (really, the person who ran
138 xscreensaver), or the root password. (\fBNote:\fP this doesn't work if the
139 screensaver is launched by
141 because it can't know the user-id of the logged-in user. See
142 the ``\fIUsing XDM(1)\fP'' section, below.
144 .B lockTimeout\fP (class \fBTime\fP)
145 If locking is enabled, this controls the length of the ``grace period''
146 between when the screensaver activates, and when the screen becomes locked.
147 For example, if this is 5, and \fI\-timeout\fP is 10, then after 10 minutes,
148 the screen would blank. If there was user activity at 12 minutes, no password
149 would be required to un-blank the screen. But, if there was user activity
150 at 15 minutes or later (that is, \fI\-lock\-timeout\fP minutes after
151 activation) then a password would be required. The default is 0, meaning
152 that if locking is enabled, then a password will be required as soon as the
155 .B passwdTimeout\fP (class \fBTime\fP)
156 If the screen is locked, then this is how many seconds the password dialog box
157 should be left on the screen before giving up (default 30 seconds.) This
158 should not be too large: the X server is grabbed for the duration that the
159 password dialog box is up (for security purposes) and leaving the server
160 grabbed for too long can cause problems.
162 .B visualID\fP (class \fBVisualID\fP)
163 Specify which X visual to use by default. (Note carefully that this resource
164 is called \fBvisualID\fP, not merely \fBvisual\fP; if you set the \fBvisual\fP
165 resource instead, things will malfunction in obscure ways for obscure reasons.)
167 Legal values for the \fBVisualID\fP resource are:
171 Use the screen's default visual (the visual of the root window.)
175 Use the visual which supports the most colors. Note, however, that the
176 visual with the most colors might be a TrueColor visual, which does not
177 support colormap animation. Some programs have more interesting behavior
178 when run on PseudoColor visuals than on TrueColor.
181 Use a monochrome visual, if there is one.
184 Use a grayscale or staticgray visual, if there is one and it has more than
185 one plane (that is, it's not monochrome.)
188 Use the best of the color visuals, if there are any.
191 where \fIclass\fP is one of \fBStaticGray\fP, \fBStaticColor\fP,
192 \fBTrueColor\fP, \fBGrayScale\fP, \fBPseudoColor\fP, or \fBDirectColor\fP.
193 Selects the deepest visual of the given class.
196 where \fInumber\fP (decimal or hex) is interpreted as a visual id number,
199 program; in this way you can have finer control over exactly which visual
200 gets used, for example, to select a shallower one than would otherwise
205 Note that this option specifies only the \fIdefault\fP visual that will
206 be used: the visual used may be overridden on a program-by-program basis.
207 See the description of the \fBprograms\fP resource, below.
210 .B installColormap\fP (class \fBBoolean\fP)
211 Install a private colormap while the screensaver is active, so that the
212 graphics hacks can get as many colors as possible. This is the
213 default. (This only applies when the screen's default visual is being
214 used, since non-default visuals get their own colormaps automatically.)
215 This can also be overridden on a per-hack basis: see the discussion of
216 the \fBdefault\-n\fP name in the section about the \fBprograms\fP resource.
218 .B verbose\fP (class \fBBoolean\fP)
219 Whether to print diagnostics. Default false.
221 .B timestamp\fP (class \fBBoolean\fP)
222 Whether to print the time of day along with any other diagnostic messages.
225 .B splash\fP (class \fBBoolean\fP)
226 Whether to display a splash screen at startup. Default true.
228 .B splashDuration\fP (class \fBTime\fP)
229 How long the splash screen should remain visible; default 5 seconds.
231 .B helpURL\fP (class \fBURL\fP)
232 The splash screen has a \fIHelp\fP button on it. When you press it, it will
233 display the web page indicated here in your web browser.
235 .B loadURL\fP (class \fBLoadURL\fP)
236 This is the shell command used to load a URL into your web browser.
237 The default setting will load it into Netscape if it is already running,
238 otherwise, will launch a new Netscape looking at the \fIhelpURL\fP.
240 .B demoCommand\fP (class \fBDemoCommand\fP)
241 This is the shell command run when the \fIDemo\fP button on the splash window
242 is pressed. It defaults to \fIxscreensaver\-demo\fP.
244 .B prefsCommand\fP (class \fBPrefsCommand\fP)
245 This is the shell command run when the \fIPrefs\fP button on the splash window
246 is pressed. It defaults to \fIxscreensaver\-demo\ \-prefs\fP.
248 .B nice\fP (class \fBNice\fP)
249 The sub-processes created by \fIxscreensaver\fP will be ``niced'' to this
250 level, so that they are given lower priority than other processes on the
251 system, and don't increase the load unnecessarily. The default is 10.
253 (Higher numbers mean lower priority; see
257 .B fade\fP (class \fBBoolean\fP)
258 If this is true, then when the screensaver activates, the current contents
259 of the screen will fade to black instead of simply winking out. This only
260 works on displays with writable colormaps, that is, if the screen's default
261 visual is a PseudoColor visual. A fade will also be done when
262 switching graphics hacks (when the \fIcycle\fP timer expires.)
265 .B unfade\fP (class \fBBoolean\fP)
266 If this is true, then when the screensaver deactivates, the original contents
267 of the screen will fade in from black instead of appearing immediately. This
268 only works on displays with writable colormaps, and if \fIfade\fP is true
269 as well. Default false.
271 .B fadeSeconds\fP (class \fBTime\fP)
272 If \fIfade\fP is true, this is how long the fade will be in
273 seconds (default 3 seconds.)
275 .B fadeTicks\fP (class \fBInteger\fP)
276 If \fIfade\fP is true, this is how many times a second the colormap will
277 be changed to effect a fade. Higher numbers yield smoother fades, but
278 may make the fades take longer than the specified \fIfadeSeconds\fP if
279 your server isn't fast enough to keep up. Default 20.
281 .B captureStderr\fP (class \fBBoolean\fP)
282 Whether \fIxscreensaver\fP should redirect its stdout and stderr streams to
283 the window itself. Since its nature is to take over the screen, you would not
284 normally see error messages generated by xscreensaver or the sub-programs it
285 runs; this resource will cause the output of all relevant programs to be
286 drawn on the screensaver window itself, as well as being written to the
287 controlling terminal of the screensaver driver process. Default true.
289 .B font\fP (class \fBFont\fP)
290 The font used for the stdout/stderr text, if \fBcaptureStderr\fP is true.
291 Default \fB*\-medium\-r\-*\-140\-*\-m\-*\fP (a 14 point fixed-width font.)
293 .B programs\fP (class \fBPrograms\fP)
294 The graphics hacks which \fIxscreensaver\fP runs when the user is idle.
295 The value of this resource is a string, one \fIsh\fP-syntax command per line.
296 Each line must contain exactly one command: no semicolons, no ampersands.
298 When the screensaver starts up, one of these is selected at random, and
299 run. After the \fIcycle\fP period expires, it is killed, and another
302 If the value of this resource is empty, then no programs will be run; the
303 screen will simply be made black.
305 If the display has multiple screens, then a different program will be run
306 for each screen. (All screens are blanked and unblanked simultaniously.)
308 Note that you must escape the newlines; here is an example of how you
309 might set this in your \fI~/.Xdefaults\fP file:
313 xscreensaver.programs: \\
315 ico -r -faces -sleep 1 -obj ico \\n\\
316 xdaliclock -builtin2 -root \\n\\
317 xv -root -rmode 5 image.gif -quit \\n
321 Make sure your \fB$PATH\fP environment variable is set up correctly
322 \fIbefore\fP xscreensaver is launched, or it won't be able to find the
323 programs listed in the \fIprograms\fP resource.
325 To use a program as a screensaver, two things are required: that that
326 program draw on the root window (or be able to be configured to draw on
327 the root window); and that that program understand ``virtual root''
328 windows, as used by virtual window managers such as \fItvtwm\fP. (Generally,
329 this is accomplished by just including the \fI"vroot.h"\fP header file in
330 the program's source.)
332 If there are some programs that you want to run only when using a color
333 display, and others that you want to run only when using a monochrome
334 display, you can specify that like this:
337 mono: mono-program -root \\n\\
338 color: color-program -root \\n\\
342 More generally, you can specify the kind of visual that should be used for
343 the window on which the program will be drawing. For example, if one
344 program works best if it has a colormap, but another works best if it has
345 a 24-bit visual, both can be accommodated:
348 PseudoColor: cmap-program -root \\n\\
349 TrueColor: 24bit-program -root \\n\\
353 (This sort of thing used to be accomplished with the \fIcolorPrograms\fP
354 and \fImonoPrograms\fP resources, but those resources have now been removed;
355 a warning will be issued if they are used.)
357 In addition to the symbolic visual names described above (in the discussion
358 of the \fIvisualID\fP resource) one other visual name is supported in
359 the \fIprograms\fP list:
363 This is like \fBdefault\fP, but also requests the use of the default colormap,
364 instead of a private colormap. (That is, it behaves as if
365 the \fI\-no\-install\fP command-line option was specified, but only for
366 this particular hack.) This is provided because some third-party programs
367 that draw on the root window (notably:
371 make assumptions about the visual and colormap of the root window:
372 assumptions which xscreensaver can violate.
375 If you specify a particular visual for a program, and that visual does not
376 exist on the screen, then that program will not be chosen to run. This
377 means that on displays with multiple screens of different depths, you can
378 arrange for appropriate hacks to be run on each. For example, if one screen
379 is color and the other is monochrome, hacks that look good in mono can be
380 run on one, and hacks that only look good in color will show up on the other.
384 Normally you won't need to change the following resources:
387 .B pointerPollTime\fP (class \fBTime\fP)
388 When server extensions are not in use, this controls how
389 frequently \fIxscreensaver\fP checks to see if the mouse position or buttons
390 have changed. Default 5 seconds.
392 .B windowCreationTimeout\fP (class \fBTime\fP)
393 When server extensions are not in use, this controls the delay between when
394 windows are created and when \fIxscreensaver\fP selects events on them.
397 .B initialDelay\fP (class \fBTime\fP)
398 When server extensions are not in use, \fIxscreensaver\fP will wait this many
399 seconds before selecting events on existing windows, under the assumption that
400 \fIxscreensaver\fP is started during your login procedure, and the window
401 state may be in flux. Default 0. (This used to default to 30, but that was
402 back in the days when slow machines and X terminals were more common...)
404 .B sgiSaverExtension\fP (class \fBBoolean\fP)
405 There are a number of different X server extensions which can make
406 xscreensaver's job easier. The next few resources specify whether these
407 extensions should be utilized if they are available.
409 This resource controls whether the SGI \fBSCREEN_SAVER\fP server extension
410 will be used to decide whether the user is idle. This is the default
411 if \fIxscreensaver\fP has been compiled with support for this
412 extension (which is the default on SGI systems.). If it is available,
413 the \fBSCREEN_SAVER\fP method is faster and more reliable than what will
414 be done otherwise, so use it if you can. (This extension is only available
415 on Silicon Graphics systems, unfortunately.)
417 .B mitSaverExtension\fP (class \fBBoolean\fP)
418 This resource controls whether the \fBMIT\-SCREEN\-SAVER\fP server extension
419 will be used to decide whether the user is idle. However, the default for
420 this resource is \fIfalse\fP, because even if this extension is available,
421 it is flaky (and it also makes the \fBfade\fP option not work properly.)
422 Use of this extension is not recommended.
424 .B xidleExtension\fP (class \fBBoolean\fP)
425 This resource controls whether the \fBXIDLE\fP server extension will be
426 used to decide whether the user is idle. This is the default
427 if \fIxscreensaver\fP has been compiled with support for this extension.
428 (This extension is only available for X11R4 and X11R5 systems, unfortunately.)
430 .B overlayStderr\fP (class \fBBoolean\fP)
431 If \fBcaptureStderr\fP is True, and your server supports ``overlay'' visuals,
432 then the text will be written into one of the higher layers instead of into
433 the same layer as the running screenhack. Set this to False to disable
434 that (though you shouldn't need to.)
436 .B overlayTextForeground\fP (class \fBForeground\fP)
437 The foreground color used for the stdout/stderr text, if \fBcaptureStderr\fP
438 is true. Default: Yellow.
440 .B overlayTextBackground\fP (class \fBBackground\fP)
441 The background color used for the stdout/stderr text, if \fBcaptureStderr\fP
442 is true. Default: Black.
444 .B bourneShell\fP (class \fBBourneShell\fP)
445 The pathname of the shell that \fIxscreensaver\fP uses to start subprocesses.
446 This must be whatever your local variant of \fB/bin/sh\fP is: in particular,
447 it must not be \fBcsh\fP.
448 .SH COMMAND-LINE OPTIONS
450 also accepts the following command line options. Except for
451 the \fI\-display\fP option, these command-line options are all
452 simply shorthand for the X resources described in
453 the \fIConfiguration\fP section, above.
455 .B \-display \fIhost:display.screen\fP
456 The X display to use. For displays with multiple screens, XScreenSaver
457 will manage all screens on the display simultaniously; the \fIscreen\fP
458 argument (the ``default'' screen) says which screen should be used for
459 dialog boxes (the password window, \fIDemo Mode\fP, etc.)
461 .B \-timeout \fIminutes\fP
462 Same as the \fItimeout\fP resource.
464 .B \-cycle \fIminutes\fP
465 Same as the \fIcycle\fP resource.
468 Same as setting the \fIlock\fP resource to \fItrue\fP.
471 Same as setting the \fIlock\fP resource to \fIfalse\fP.
473 .B \-lock\-timeout \fIminutes\fP
474 Same as the \fIlockTimeout\fP resource.
476 .B \-visual \fIvisual\fP
477 Same as the \fIvisualID\fP resource.
480 Same as setting the \fIinstallColormap\fP resource to \fItrue\fP.
483 Same as setting the \fIinstallColormap\fP resource to \fIfalse\fP.
486 Same as setting the \fIverbose\fP resource to \fItrue\fP.
489 Same as setting the \fIverbose\fP resource to \fIfalse\fP.
492 Same as setting the \fItimestamp\fP resource to \fItrue\fP.
495 Same as setting the \fIcaptureStderr\fP resource to \fItrue\fP.
497 .B \-no\-capture\-stderr
498 Same as setting the \fIcaptureStderr\fP resource to \fIfalse\fP.
501 Same as setting the \fIsplash\fP resource to \fItrue\fP.
504 Same as setting the \fIsplash\fP resource to \fIfalse\fP.
506 .B \-nice \fIinteger\fP
507 Same as the \fInice\fP resource.
510 Same as setting the \fIsgiSaverExtension\fP resource to \fItrue\fP.
512 .B \-no\-sgi\-extension
513 Same as setting the \fIsgiSaverExtension\fP resource to \fIfalse\fP.
516 Same as setting the \fImitSaverExtension\fP resource to \fItrue\fP.
518 .B \-no\-mit\-extension
519 Same as setting the \fImitSaverExtension\fP resource to \fIfalse\fP.
521 .B \-xidle\-extension
522 Same as setting the \fIxidleExtension\fP resource to \fItrue\fP.
524 .B \-no\-xidle\-extension
525 Same as setting the \fIxidleExtension\fP resource to \fIfalse\fP.
527 .B \-xrm \fIresource-specification\fP
528 As with all other Xt programs, you can specify X resources on the command-line
529 using the \fI\-xrm\fP argument. Most of the interesting resources have
530 command-line equivalents, however.
532 When it is time to activate the screensaver, a full-screen black window is
533 created on each screen of the display. The window or windows is given the
534 appropriate properties so that, to any subsequently-created programs, it
535 will appear to be a ``virtual root'' window. Because of this, any program
536 which draws on the root window (and which understands virtual roots) can be
537 used as a screensaver.
539 When the user becomes active again, the screensaver windows are unmapped and
540 the running subprocesses are killed by sending them \fBSIGTERM\fP. This is
541 also how the subprocesses are killed when the screensaver decides that it's
542 time to run a different demo: the old one is killed and a new one is launched.
544 Before launching a subprocess, \fIxscreensaver\fP stores an appropriate value
545 for \fB$DISPLAY\fP in the environment that the child will recieve. (This is
546 so that if you start \fIxscreensaver\fP with a \fI-display\fP argument, the
547 programs which \fIxscreensaver\fP launches will draw on the same display;
548 and so that the child will end up drawing on the appropriate screen of a
549 multi-headed display.)
551 When the screensaver turns off, or is killed, care is taken to restore
552 the ``real'' virtual root window if there is one. Because of this, it is
553 important that you not kill the screensaver process with \fIkill -9\fP if
554 you are running a virtual-root window manager. If you kill it with \-9,
555 you may need to restart your window manager to repair the damage. This
556 isn't an issue if you aren't running a virtual-root window manager.
558 For all the gory details, see the commentary at the top of xscreensaver.c.
560 You can control a running screensaver process by using the
561 .BR xscreensaver\-command (1)
564 Modern X servers contain support to power down the monitor after an idle
565 period. If the monitor has powered down, then \fIxscreensaver\fP will
566 notice this, and will not waste CPU by drawing graphics demos on a black
567 screen. An attempt will also be made to explicitly power the monitor
568 back up as soon as user activity is detected.
570 If your X server supports power management, then
572 will accept a \fBdpms\fP option. So, if you wanted \fIxscreensaver\fP
573 to activate after 5 minutes, but you wanted your monitor to power down
574 after one hour (3600 seconds) you would do this:
578 See the man page for the
580 program for details. (Note that power management requires both software
581 support in the X server, and hardware support in the monitor itself.)
583 You can run \fIxscreensaver\fP from your
585 session, so that the screensaver will run even when nobody is logged
588 The trick to using xscreensaver with \fIxdm\fP is this: keep in mind the
589 two very different states in which xscreensaver will be running:
592 .B 1: Nobody logged in.
594 If you're thinking of running xscreensaver from XDM at all, then it's
595 probably because you want graphics demos to be running on the console
596 when nobody is logged in there. In this case, xscreensaver will function
597 only as a screen saver, not a screen locker: it doesn't make sense
598 for xscreensaver to lock the screen, since nobody is logged in yet!
599 The only thing on the screen is the XDM login prompt.
601 .B 2: Somebody logged in.
603 Once someone has logged in through the XDM login window, the situation is
604 very different. For example: now it makes sense to lock the screen (and
605 prompt for the logged in user's password); and now xscreensaver should
606 consult that user's \fI~/.xscreensaver\fP file; and so on.
609 The difference between these two states comes down to a question of,
610 which user is the \fIxscreensaver\fP process running as? For the first
611 state, it doesn't matter. If you start \fIxscreensaver\fP in the usual
612 XDM way, then xscreensaver will probably end up running as root, which
613 is fine for the first case (the ``nobody logged in'' case.)
615 However, once someone is logged in, running as root is no longer fine:
616 because xscreensaver will be consulting root's \fI.xscreensaver\fP file
617 instead of that of the logged in user, and won't be prompting for the
618 logged in user's password, and so on. (This is not a security problem,
619 it's just not what you want.)
621 So, once someone has logged in, you want xscreensaver to be running as that
622 user. The way to accomplish this is to kill the old xscreensaver process
623 and start a new one (as the new user.)
625 The simplest way to accomplish all of this is as follows:
628 .B 1: Launch xscreensaver before anyone logs in.
630 To the file \fI/usr/lib/X11/xdm/Xsetup\fP, add the lines
632 xscreensaver-command -exit
635 This will run xscreensaver as root, over the XDM login window.
636 Moving the mouse will cause the screen to un-blank, and allow the user
637 to type their password at XDM to log in.
639 .B 2: Restart xscreensaver when someone logs in.
641 Near the top of the file \fI/usr/lib/X11/xdm/Xsession\fP, add those same lines:
643 xscreensaver-command -exit
646 When someone logs in, this will kill off the existing (root) xscreensaver
647 process, and start a new one, running as the user who has just logged in.
648 If the user's .xscreensaver file requests locking, they'll get it. They
649 will also get their own choice of timeouts, and graphics demos, and so on.
651 Alternately, each user could just put those lines in their
652 personal \fI~/.xsession\fP files.
655 Make sure you have \fB$PATH\fP set up correctly in the \fIXsetup\fP
656 and \fIXsession\fP scripts, or \fIxdm\fP won't be able to
657 find \fIxscreensaver\fP, and/or \fIxscreensaver\fP won't be able to
658 find its graphics demos.
660 (If your system does not seem to be executing the \fIXsetup\fP file, you
661 may need to configure it to do so: the traditional way to do this is
662 to make that file the value of the \fIDisplayManager*setup\fP resource
663 in the \fI/usr/lib/X11/xdm/xdm-config\fP file. See the man page for
667 It is safe to run \fIxscreensaver\fP as root (as \fIxdm\fP is likely to do.)
668 If run as root, \fIxscreensaver\fP changes its effective user and group ids
669 to something safe (like \fI"nobody"\fP) before connecting to the X server
670 or launching user-specified programs.
672 An unfortunate side effect of this (important) security precaution is that
673 it may conflict with cookie-based authentication.
675 If you get "connection refused" errors when running \fIxscreensaver\fP
676 from \fIxdm\fP, then this probably means that you have
678 or some other security mechanism turned on. One way around this is to
679 add \fB"xhost\ +localhost"\fP to \fIXsetup\fP, just before \fIxscreensaver\fP
682 Note that this will give access to the X server to anyone capable of logging
683 in to the local machine, so in some environments, this might not be
684 appropriate. If turning off file-system-based access control is not
685 acceptable, then running \fIxscreensaver\fP from the \fIXsetup\fP file
686 might not be possible, and xscreensaver will only work when running as
687 a normal, unprivileged user.
689 For more information on the X server's access control mechanisms, see the
696 .SH USING CDE (COMMON DESKTOP ENVIRONMENT)
697 The easiest way to use \fIxscreensaver\fP on a system with CDE is to simply
698 switch off the built-in CDE screensaver, and use \fIxscreensaver\fP instead;
699 and second, to tell the front panel to run
700 .BR xscreensaver\-command (1)
701 with the \fI\-lock\fP option when the \fILock\fP icon is clicked.
703 To accomplish this involves five steps:
706 \fB1: Switch off CDE's locker\fP
707 Do this by turning off ``\fIScreen Saver and Screen Lock\fP'' in the
708 Screen section of the Style Manager.
710 \fB2: Edit sessionetc\fP
711 Edit the file \fI~/.dt/sessions/sessionetc\fP and add to it the line
715 This will cause \fIxscreensaver\fP to be launched when you log in.
716 (As always, make sure that xscreensaver and the graphics demos are on
717 your \fB$PATH\fP; the path needs to be set in \fI.cshrc\fP
718 and/or \fI.dtprofile\fP, not \fI.login\fP.)
720 \fB3: Create XScreenSaver.dt\fP
721 Create a file called \fI~/.dt/types/XScreenSaver.dt\fP with the following
728 EXEC_STRING xscreensaver-command -lock
733 This defines a ``lock'' command for the CDE front panel, that knows how
734 to talk to \fIxscreensaver\fP.
736 \fB4: Create Lock.fp\fP
737 Create a file called \fI~/.dt/types/Lock.fp\fP with the following
743 CONTAINER_NAME Switch
744 CONTAINER_TYPE SWITCH
748 PUSH_ACTION XScreenSaver
749 HELP_TOPIC FPOnItemLock
753 This associates the CDE front panel ``Lock'' icon with the lock command
754 we just defined in step 3.
757 Select ``\fIRestart Workspace Manager\fP'' from the popup menu to make
758 your changes take effect. If things seem not to be working, check the
759 file \fI~/.dt/errorlog\fP for error messages.
761 .SH USING HP VUE (VISUAL USER ENVIRONMENT)
762 Since CDE is a descendant of VUE, the instructions for using xscreensaver
763 under VUE are similar to the above:
766 \fB1: Switch off VUE's locker\fP
767 Open the ``\fIStyle Manager\fP'' and select ``\fIScreen\fP.''
768 Turn off ``\fIScreen Saver and Screen Lock\fP'' option.
770 \fB2: Make sure you have a Session\fP
771 Next, go to the Style Manager's, ``\fIStartup\fP'' page.
772 Click on ``\fISet Home Session\fP'' to create a session, then
773 on ``\fIReturn to Home Session\fP'' to select this session each
776 \fB3: Edit vue.session\fP
777 Edit the file \fI~/.vue/sessions/home/vue.session\fP and add to it
780 vuesmcmd -screen 0 -cmd "xscreensaver"
782 This will cause \fIxscreensaver\fP to be launched when you log in.
783 (As always, make sure that xscreensaver and the graphics demos are on
784 your \fB$PATH\fP; the path needs to be set in \fI.cshrc\fP
785 and/or \fI.profile\fP, not \fI.login\fP.)
787 \fB3: Edit vuewmrc\fP
788 Edit the file \fI~/.vue/vuewmrc\fP and add (or change) the Lock control:
794 PUSH_ACTION f.exec "xscreensaver-command -lock"
798 This associates the VUE front panel ``Lock'' icon with the xscreensaver
804 .BR xscreensaver-command (1)
805 program is a perfect candidate for something to add to your window manager's
806 popup menus. If you use
810 or (probably) any of \fItwm\fP's many descendants, you can do it like this:
813 \fB1. Create ~/.mwmrc (or ~/.twmrc or ...)\fP
814 If you don't have a \fI~/.mwmrc\fP file (or, on SGIs, a \fI~/.4Dwmrc\fP file;
815 or, with twm, a \fI~/.twmrc\fP file) then create one by making a copy of
816 the \fI/usr/lib/X11/system.mwmrc\fP
817 file (or \fI/usr/lib/X11/twm/system.twmrc\fP, and so on.)
819 \fB2. Add a menu definition.\fP
824 "Blank Screen Now" !"sleep 3; xscreensaver-command -activate"
825 "Lock Screen Now" !"sleep 3; xscreensaver-command -lock"
826 "Screen Saver Demo" !"xscreensaver-demo"
827 "Screen Saver Preferences" !"xscreensaver-demo -prefs"
828 "Reinitialize Screen Saver" !"xscreensaver-command -restart"
829 "Kill Screen Saver" !"xscreensaver-command -exit"
830 "Launch Screen Saver" !"xscreensaver &"
834 \fB3. Add the menu\fP
839 find the section of the file that says \fIMenu DefaultRootMenu\fP.
842 it will probably be \fImenu "defops"\fP. If you add a line somewhere
843 in that menu definition that reads
845 "XScreenSaver" f.menu XScreenSaver
847 then this will add an XScreenSaver sub-menu to your default root-window
848 popup menu. Alternately, you could just put the xscreensaver menu items
849 directly into the root menu.
852 Other window managers are guaranteed to do things gratuitously differently.
854 Bugs? There are no bugs. Ok, well, maybe. If you find one, please let
855 me know. http://www.jwz.org/xscreensaver/bugs.html explains how to
856 construct the most useful bug reports.
859 If xscreensaver has been launched from
861 before anyone has logged in, you will need to kill and then restart the
862 xscreensaver daemon after you have logged in, or you will be confused by
863 the results. (For example, locking won't work, and your \fI~/.xscreensaver\fP
864 file will be ignored.)
866 When you are logged in, you want the \fIxscreensaver\fP daemon to be
867 running under \fIyour\fP user id, not as root or some other user.
869 If it has already been started by \fIxdm\fP, you can kill it by sending
870 it the \fBexit\fP command, and then re-launching it as you, by putting
871 something like the following in your personal X startup script:
873 xscreensaver-command -exit
876 The ``\fIUsing XDM(1)\fP'' section, above, goes into more detail, and explains
877 how to configure the system to do this for all users automatically.
879 .B Locking and root logins
880 In order for it to be safe for xscreensaver to be launched by \fIxdm\fP,
881 certain precautions had to be taken, among them that xscreensaver never
882 runs as \fIroot\fP. In particular, if it is launched as root (as \fIxdm\fP
883 is likely to do), xscreensaver will disavow its privileges, and switch to
884 a safe user id (such as \fInobody\fP.)
886 An implication of this is that if you log in as \fIroot\fP on the console,
887 xscreensaver will refuse to lock the screen (because it can't tell
888 the difference between \fIroot\fP being logged in on the console, and a
889 normal user being logged in on the console but xscreensaver having been
895 The solution to this is simple: you shouldn't be logging in on the console
896 as \fIroot\fP in the first place! (What, are you crazy or something?)
898 Proper Unix hygiene dictates that you should log in as yourself, and
900 to \fIroot\fP as necessary. People who spend their day logged in
901 as \fIroot\fP are just begging for disaster.
904 For xscreensaver to work when launched by
906 programs running on the local machine as user \fI"nobody"\fP must be
907 able to connect to the X server. This means that if you want to run
908 xscreensaver on the console while nobody is logged in, you may need
909 to disable cookie-based access control (and allow all users who can log
910 in to the local machine to connect to the display.)
912 You should be sure that this is an acceptable thing to do in your
913 environment before doing it. See the ``\fIUsing XDM(1)\fP'' section,
914 above, for more details.
916 If anyone has suggestions on how xscreensaver could be made to work with
918 without first turning off \fI.Xauthority\fP-based access control, please
922 If you get an error message like ``couldn't get password of \fIuser\fP''
923 then this probably means that you're on a system in which the
925 library routine can only be effectively used by root. If this is the case,
926 then \fIxscreensaver\fP must be installed as setuid to root. Care has
927 been taken to make this a safe thing to do.
929 It also may mean that your system uses shadow passwords instead of the standard
931 interface; in that case, you may need to change some options
932 with \fIconfigure\fP and recompile.
934 If you change your password after xscreensaver has been launched, it will
935 continue using your old password to unlock the screen until xscreensaver
936 is restarted. So, after you change your password, you'll have to do
938 xscreensaver-command -restart
940 to make \fIxscreensaver\fP notice.
942 .B Colormap lossage: TWM
943 The \fBinstallColormap\fP option doesn't work very well with the
945 window manager and its descendants.
947 There is a race condition between the screensaver and this window manager,
948 which can result in the screensaver's colormap not getting installed
949 properly, meaning the graphics hacks will appear in essentially random
950 colors. (If the screen goes white instead of black, this is probably why.)
956 window managers don't seem to have this problem. The race condition exists
957 because X does not provide a way for an OverrideRedirect window to have its
958 own colormap, short of grabbing the server (which is neither a good idea, nor
959 really possible with the current design.) What happens is that, as soon as
960 the screensaver installs its colormap, \fBtwm\fP responds to
961 the \fBColormapNotify\fP event that is generated by re-instaling the default
962 colormap. Apparently, \fBtwm\fP doesn't \fIalways\fP do this; it seems to do
963 it regularly if the screensaver is activated from a menu item, but seems to
964 not do it if the screensaver comes on of its own volition, or is activated
965 from another console. Any thoughts on this problem are welcome...
967 .B Colormap lossage: XV, XAnim, XEarth
968 Some programs don't operate properly on visuals other than the default one,
969 or with colormaps other than the default one. See the discussion of the
970 magic "default-n" visual name in the description of the \fBprograms\fP
971 resource in the \fIConfiguration\fP section. When programs only work with
972 the default colormap, you need to use a syntax like this:
974 default-n: xv -root image-1.gif -quit \\n\\
975 default-n: xearth -nostars -wait 0 \\n\\
977 It would also work to turn off the \fBinstallColormap\fP option altogether,
978 but that would deny extra colors to those programs that \fIcan\fP take
982 Although this program ``nices'' the subprocesses that it starts,
983 graphics-intensive subprograms can still overload the machine by causing
984 the X server process itself (which is not ``niced'') to suck a lot of
985 cycles. Care should be taken to slow down programs intended for use as
986 screensavers by inserting strategic calls to
990 (or making liberal use of any \fI\-delay\fP options which the programs
993 Note that the OpenGL-based graphics demos are real pigs on machines that
994 don't have texture hardware.
996 Also, an active screensaver will cause your X server to be pretty much
997 permanently swapped in; but the same is true of any program that draws
1004 On some systems, Doom, Quake, and other games intercept the keyboard in
1005 ways that X programs can never detect. Therefore, when running these games,
1006 xscreensaver might think the console is idle, and activate. In the worst
1007 case, xscreensaver might blank the screen and mess up the game. Alternately,
1008 xscreensaver might activate on the X display while leaving the game visible,
1009 and merely cause the game to slow down.
1011 I don't know how to fix this, because I don't know how to detect the kind
1012 of keyboard activity that occurs during these games. Suggestions are welcome.
1014 .B Latency and Responsiveness
1015 If the subprocess is drawing too quickly and the connection to the X
1016 server is a slow one (such as an X terminal running over a phone line) then
1017 the screensaver might not turn off right away when the user becomes active
1020 demo has this problem if being run in full-speed mode). This can be
1021 alleviated by inserting strategic calls to
1023 in code intended for use as a screensaver. This prevents too much graphics
1024 activity from being buffered up.
1027 Apparently there are some problems with XView programs getting confused
1028 and thinking that the screensaver window is the real root window even when
1029 the screensaver is not active: ClientMessages intended for the window manager
1030 are sent to the screensaver window instead. This could be solved by making
1031 xscreensaver forward all unrecognised ClientMessages to the real root window,
1032 but there may be other problems as well. If anyone has any insight on the
1033 cause of this problem, please let me know. (XView is an X11 toolkit that
1034 implements the (quite abominable) Sun OpenLook look-and-feel.)
1036 .B MIT Extension and Fading
1037 The \fBMIT-SCREEN-SAVER\fP extension is junk. Don't use it.
1039 When using the \fBMIT-SCREEN-SAVER\fP extension in conjunction with
1040 the \fBfade\fP option, you'll notice an unattractive flicker just before
1041 the fade begins. This is because the server maps a black window just before
1042 it tells the \fIxscreensaver\fP process to activate. The \fIxscreensaver\fP
1043 process immediately unmaps that window, but this results in a flicker. I
1044 haven't figured a way to get around this; it seems to be a fundamental
1045 property of the (mis-) design of this server extension.
1047 It sure would be nice if someone would implement the \fBSGI SCREEN_SAVER\fP
1048 extension in XFree86; it's dead simple, and works far better than the
1049 overengineered and broken \fBMIT-SCREEN-SAVER\fP extension.
1052 If you're running Irix 6.3, you might find that your monitor is powering down
1053 after an hour or two even if you've told it not to. This is fixed by SGI
1054 patches 2447 and 2537.
1056 .B OpenGL Programs and Visuals
1057 Some of the graphics demos included with xscreensaver make use of the
1058 OpenGL (or MesaGL) 3D library, if it is available. It is possible (even
1059 likely) that \fIxscreensaver\fP's notion of the ``\fIbest\fP'' visual is
1060 not quite right for these GL programs.
1062 The odd thing about GL programs is that, unlike normal X11 programs, they
1063 tend to work best on a visual \fIhalf\fP as deep as the depth of the screen,
1064 since that way, they can do double-buffering. Try it and see, but you will
1065 probably find that, for these particular programs, you should specify the
1066 deepest visual that is half as deep as the screen. (See the discussion
1067 of the \fBprograms\fP resource in the \fIConfiguration\fP section, above.)
1069 For example, on a screen that supports both 24-bit TrueColor and 12-bit
1070 PseudoColor visuals, the 12-bit visual will probably work best (this is true
1071 of base-model SGI Indys: the 0x29 visual is the one you want.)
1073 Oddly, on SGI O2s (machines that have serious hardware support for GL), the
1074 12-bit PseudoColor visual looks awful (you get a black and white, flickery
1075 image.) On these machines, the visual you want turns out to be 0x31.
1076 However, 0x31 is but \fIone\fP of the \fIeight\fP 15-bit TrueColor visuals
1077 (yes, 8, and yes, 15) that the O2 X server provides. This is the only visual
1078 that works properly: as far as
1080 is concerned, all of the 15-bit TrueColor visuals are identical, but some
1081 flicker like mad, and some have deeply weird artifacts (such as hidden
1082 surfaces that show through, as if depth worked backwards!)
1084 I suppose these other visuals must be tied to some arcane hardware feature...
1085 If anyone would care to explain it to me, that would be great.
1087 Your mileage, therefore, may vary dramatically.
1089 .B MesaGL and Voodoo Cards
1090 If you have a 3Dfx/Voodoo card, the default settings for xscreensaver will run
1091 the GL-based graphics demos in such a way that they will not take advantage
1092 of the 3D acceleration hardware. The solution is to change the \fBprograms\fP
1093 entries for the GL hacks from this:
1099 MESA_GLX_FX=fullscreen gears \\n\\
1101 That is, make sure that \fB$MESA_GLX_FX\fP is set to \fIfullscreen\fP, and
1102 don't tell the program to draw on the root window. This may seem strange,
1103 but the setup used by Mesa and these kinds of cards \fIis\fP strange!
1105 For those who don't know, these cards work by sitting between your normal
1106 video card and the monitor, and seizing control of the monitor when it's
1107 time to do 3D. But this means that accelerated 3D only happens in full-screen
1108 mode (you can't do it in a window) and that 3D will probably drive your
1109 monitor at a lower resolution, as well. It's bizarre.
1112 If you are not making use of one of the server extensions (\fBXIDLE\fP,
1113 \fBSGI SCREEN_SAVER\fP, or \fBMIT-SCREEN-SAVER\fP), then it is possible, in
1114 rare situations, for \fIxscreensaver\fP to interfere with event propagation
1115 and make another X program malfunction. For this to occur, that other
1116 application would need to \fInot\fP select \fBKeyPress\fP events on its
1117 non-leaf windows within the first 30 seconds of their existence, but then
1118 select for them later. In this case, that client \fImight\fP fail to receive
1119 those events. This isn't very likely, since programs generally select a
1120 constant set of events immediately after creating their windows and then
1121 don't change them, but this is the reason that it's a good idea to install
1122 and use one of the server extensions instead, to work around this shortcoming
1125 In all these years, I've not heard of even a single case of this happening,
1126 but it is theoretically possible, so I'm mentioning it for completeness...
1129 There need to be a lot more graphics hacks. In particular, there should be
1130 a simulation of a Lavalite (tm).
1135 to get the default host and display number, and to inform the sub-programs
1136 of the screen on which to draw.
1139 to find the sub-programs to run.
1142 for the directory in which to read and write the \fI.xscreensaver\fP file.
1145 to get the name of a resource file that overrides the global resources
1146 stored in the RESOURCE_MANAGER property.
1148 The latest version can always be found at
1149 http://www.jwz.org/xscreensaver/
1152 .BR xscreensaver\-demo (1),
1153 .BR xscreensaver\-command (1),
1170 .BR decayscreen (1),
1189 .BR interference (1),
1192 .BR kaleidescope (1),
1217 .BR slidescreen (1),
1225 .BR superquadrics (1),
1237 .BR xbouncebits (1),
1248 Copyright \(co 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
1249 by Jamie Zawinski. Permission to use, copy, modify, distribute, and sell
1250 this software and its documentation for any purpose is hereby granted without
1251 fee, provided that the above copyright notice appear in all copies and that
1252 both that copyright notice and this permission notice appear in supporting
1253 documentation. No representations are made about the suitability of this
1254 software for any purpose. It is provided "as is" without express or implied
1257 Jamie Zawinski <jwz@jwz.org>. Written in late 1991; first posted
1258 to comp.sources.x on 13-Aug-1992.
1260 Please let me know if you find any bugs or make any improvements.
1261 .SH ACKNOWLEDGEMENTS
1262 Thanks to David Wojtowicz for implementing \fIlockTimeout\fP.
1264 Thanks to Martin Kraemer for adding support for shadow passwords and
1265 locking-disabled diagnostics.
1267 Thanks to the many people who have contributed graphics demos to the package.
1269 Thanks to Patrick Moreau for the VMS port.
1271 Thanks to Mark Bowyer for figuring out how to hook it up to CDE.
1273 And huge thanks to Jon A. Christopher for implementing the Athena dialog
1274 support, back in the days before Lesstif was a viable alternative to Motif.