14 .TH XScreenSaver 1 "22-mar-93" "X Version 11"
16 xscreensaver - run graphics hacks after the user has been idle for a while
19 [\-display \fIhost:display.screen\fP] [\-timeout \fIint\fP] [\-cycle \fIint\fP] [\-nice \fIint\fP] [\-verbose] [\-silent] [\-xidle] [\-no-xidle] [\-lock] [\-no-lock] [\-lock\-timeout \fIint\fP] [\-demo] [\-xrm \fIresources\fP]
21 The \fIxscreensaver\fP program waits until the keyboard and mouse have been
22 idle for a period, and then runs a graphics demo chosen at random. It
23 turns off as soon as there is any mouse or keyboard activity.
25 This program can lock your terminal in order to prevent others from using it,
26 though its default mode of operation is merely to display pretty pictures on
27 your screen when it is not in use.
29 The benefit that this program has over the combination of the
33 programs is the ease with which new graphics hacks can be installed. You
34 don't need to recompile (or even re-run) this program to add a new display
38 accepts the following options:
40 .B \-timeout \fIminutes\fP
41 The screensaver will activate after the keyboard and mouse have been idle
42 for this many minutes.
44 .B \-cycle \fIminutes\fP
45 After the screensaver has been running for this many minutes, the currently
46 running sub-process will be killed (with \fBSIGTERM\fP), and a new one
47 started. If this is 0, then the sub-process will not be killed; only one
48 demo will run until the screensaver is deactivated by user activity.
50 .B \-nice \fIinteger\fP
51 The sub-processes created by \fIxscreensaver\fP will be ``niced'' to this
52 level, so that they do not consume cycles that are needed elsewhere.
61 Use the \fIXIdle\fP server extension to decide whether the user is idle.
62 This is the default if \fIxscreensaver\fP has been compiled with support
63 for XIdle. The XIdle method is faster and more reliable than what will
64 be done otherwise, so use it if you can.
67 Don't use \fIXIdle\fP.
70 Enable locking: before the screensaver will turn off, it requires you to
71 type the password of the person who launched the screensaver, or the root
72 password. (Note: this doesn't work if the screensaver is launched
75 because it can't know the user-id of the logged-in user.)
78 Disable locking. This is the default.
80 .B \-lock\-timeout \fIminutes\fP
81 This is how long after the screensaver activates that locking is enabled.
82 For example, if this is 5, then any user activity within five minutes of
83 the time when the screensaver activated will cause the screen to unblank
84 without requiring a password. After 5 minutes, a password will be
85 required. The default is 0, meaning that if locking is enabled, then
86 a password will be required as soon as the screensaver activates.
89 Enter the interactive demo mode immediately after startup. Normally
90 demo mode is invoked via the
91 .BR xscreensaver\-command (1)
94 \fIxscreensaver\fP understands the following resources:
97 .B timeout \fR(class \fBTime\fP)
98 Same as the \fI\-timeout\fP command-line option. Default 10 minutes.
100 .B cycle \fR(class \fBTime\fP)
101 Same as the \fI\-cycle\fP command-line option. Default 10 minutes.
103 .B nice \fR(class \fBNice\fP)
104 Same as the \fI\-nice\fP command-line option. Default 10.
106 .B verbose \fR(class \fBBoolean\fP)
107 Same as the \fI\-verbose\fP command-line option.
109 .B xidle \fR(class \fBBoolean\fP)
110 Same as the \fI\-xidle\fP command-line option.
112 .B lock \fR(class \fBBoolean\fP)
113 Same as the \fI\-lock\fP command-line option.
115 .B lockTimeout \fR(class \fBTime\fP)
116 Same as the \fI\-lock\-timeout\fP command-line option.
118 .B fade \fR(class \fBBoolean\fP)
119 If this is true, then when the screensaver activates, the current contents
120 of the screen will fade to black instead of simply winking out. This only
121 works on displays with writable colormaps. Default true. A fade will also
122 be done when switching graphics hacks (when the \fIcycle\fP timer expires.)
124 .B unfade \fR(class \fBBoolean\fP)
125 If this is true, then when the screensaver deactivates, the original contents
126 of the screen will fade in from black instead of appearing immediately. This
127 only works on displays with writable colormaps, and if \fIfade\fP is true
128 as well. Default false.
130 .B fadeSeconds \fR(class \fBTime\fP)
131 If \fIfade\fP is true, this is how long the fade will be in
134 .B fadeTicks \fR(class \fBInteger\fP)
135 If \fIfade\fP is true, this is how many times a second the colormap will
136 be changed to effect a fade. Higher numbers yield smoother fades, but
137 may make the fades take longer if your server isn't fast enough to keep
140 .B installColormap \fR(class \fBBoolean\fP)
141 Whether a new colormap should be installed while the screensaver is on,
142 so that the graphics hacks can get as many colors as possible. Default
145 .B passwdTimeout \fR(class \fBTime\fP)
146 If \fIlock\fP is true, this is how many seconds the password dialog box
147 should be left on the screen before giving up (default 30.) This should
148 not be too large: the X server is grabbed for the duration that the password
149 dialog box is up (for security purposes) and leaving the server grabbed for
150 too long can cause problems.
152 .B programs \fR(class \fBPrograms\fP)
153 The graphics hacks which \fIxscreensaver\fP runs when the user is idle.
154 The value of this resource is a string, one \fIsh\fP command per line.
155 Each line must contain exactly one command -- no semicolons.
157 When the screensaver starts up, one of these is selected at random, and
158 run. After the \fIcycle\fP period expires, it is killed, and another
161 If the value of this resource (and the applicable one of \fBcolorPrograms\fP
162 or \fBmonoPrograms\fP) is empty, then no programs will be run; the screen
163 will simply be made black.
165 Note that you must escape the newlines; here is an example of how you
166 might set this in your \fI.Xdefaults\fP file:
168 xscreensaver.programs: \\
170 ico -r -faces -sleep 1 -obj ico \\n\\
171 xdaliclock -builtin2 -root \\n\\
174 To use a program as a screensaver, two things are required: that that
175 program draw on the root window (or be able to be configured to draw on
176 the root window); and that that program understand ``virtual root''
177 windows, as used by virtual window managers such as \fItvtwm\fP.
179 It is quite easy to make programs understand virtual roots if they
180 don't already: you merely need to include the file \fI"vroot.h"\fP in
181 them after the standard X includes, and recompile. This file is distributed
182 with X11r5, and is included with xscreensaver as well.
184 .B monoPrograms \fR(class \fBMonoPrograms\fP)
185 This resource is appended to the value of the \fIprograms\fP resource if
186 the display on which the screensaver is running is monochrome.
188 .B colorPrograms \fR(class \fBColorPrograms\fP)
189 This resource is appended to the value of the \fIprograms\fP resource if
190 the display on which the screensaver is running is not monochrome.
192 Normally you won't need to change the following resources:
194 .B bourneShell \fR(class \fBBourneShell\fP)
195 The pathname of the shell that \fIxscreensaver\fP uses to start subprocesses.
196 This must be whatever your local variant of \fB/bin/sh\fP is -- in particular,
197 it must not be \fBcsh\fP.
199 .B windowCreationTimeout \fR(class \fBTime\fP)
200 When \fIXIdle\fP is not in use, this controls the delay between when
201 windows are created and when \fIxscreensaver\fP selects events on them.
204 .B pointerPollTime \fR(class \fBTime\fP)
205 When \fIXIdle\fP is not in use, this controls how frequently \fIxscreensaver\fP
206 checks to see if the mouse position or buttons have changed. Default 5 seconds.
208 .B initialDelay \fR(class \fBTime\fP)
209 When \fIXIdle\fP is not in use, \fIxscreensaver\fP will wait this many seconds
210 before selecting events on existing windows, under the assumption that
211 \fIxscreensaver\fP is started during your login procedure, and the window
212 state may be in flux. Default 30 seconds.
214 When it is time to activate the screensaver, a full-screen black window is
215 created. This window is given the appropriate properties so that, to any
216 subsequently-created programs, it will appear to be a ``virtual root''
217 window. Because of this, any program which draws on the root window (and
218 which understands virtual roots) can be used as a screensaver.
220 When the user becomes active again, the screensaver window is unmapped and
221 the running subprocess is killed by sending it \fBSIGTERM\fP. This is also
222 how the subprocesses are killed when the screensaver decides that it's time
223 to run a different demo: the old one is killed and a new one is launched.
225 Before launching a subprocess, \fIxscreensaver\fP stores an appropriate value
226 for \fB$DISPLAY\fP in the environment that the child will recieve. (This is
227 so that if you start \fIxscreensaver\fP with a \fI-display\fP argument, the
228 programs which \fIxscreensaver\fP launches will draw on the same display.)
230 When the screensaver turns off, or is killed, care is taken to restore
231 the ``real'' virtual root window if there is one. Because of this, it is
232 important that you not kill the screensaver process with \fIkill -9\fP if
233 you are running a virtual-root window manager. If you kill it with \-9,
234 you may need to restart your window manager to repair the damage. This
235 isn't an issue if you aren't running a virtual-root window manager.
237 For all the gory details, see the commentary at the top of xscreensaver.c.
239 You can control a running screensaver process by using the
240 .BR xscreensaver\-command (1)
246 to get the default host and display number.
249 to get the name of a resource file that overrides the global resources
250 stored in the RESOURCE_MANAGER property.
252 You can run \fIxscreensaver\fP from your xdm session, so that the
253 screensaver will run even when nobody is logged in on the console.
254 Simply add \fB"xscreensaver &"\fP to your \fI/usr/lib/X11/xdm/Xsetup\fP
255 file. Because \fIxdm\fP grabs the keyboard, keypresses will not make
256 the screensaver deactivate, but any mouse activity will.
258 Users may want to add \fB"xscreensaver-command -restart"\fP to their
259 startup scripts, so that the screensaver will be reinitialized with
260 their private resource settings when they log in.
262 It is safe to run this program as root (as \fIxdm\fP is likely to do.) If
263 run as root, \fIxscreensaver\fP changes its effective user and group ids to
264 something safe (like \fI"nobody"\fP) before connecting to the X server
265 or launching user-specified programs.
267 Locking doesn't work if the screensaver is launched by \fIxdm\fP. To get
268 around this, you can run the screensaver from \fIxdm\fP without locking,
269 and kill and restart it from your personal X startup script to enable
272 If \fIxscreensaver\fP receives the \fBDEMO\fP ClientMessage, it pops up
273 a dialog box from which you can examine and experiment with the screensaver's
276 Clicking left on an element in the scrolling list will place the indicated
277 program and its args in the text field to be edited. Edit the arguments and
278 hit return to run the program with the parameters you have specified.
280 Double-clicking on an element in the scrolling list will run the indicated
283 When a client program is launched, the dialog box is hidden. Clicking
284 any mouse button will re-expose the dialog box (but will not kill the
288 Clicking this button will run the next program in the list after the
289 currently-selected one, and will scroll around to the top when it reaches
293 Opposite of Run Next; at the top, it scrolls around to the bottom.
296 This pops up a second dialog box, in which you have the option to
297 interactively change most of the screensaver's operational parameters,
298 such as its timeouts, and whether it should hack colormaps. Changing
299 these parameters here will affect only the running \fIxscreensaver\fP
300 process; to make the changes permanent, you need to edit your X resource
304 Returns to normal screensaver operation.
307 Causes the screensaver process to exit and then restart with the same
308 command-line arguments. This causes the X resource database to be
309 re-read. This is just like the \fI\-restart\fP argument to
310 .BR xscreensaver\-command (1)
311 except that when executed from this button, the screensaver will
312 automatically return to demo mode after restarting.
315 .BR xscreensaver\-command (1),
341 If you are not using \fIXIdle\fP, and an application does not
342 select \fBKeyPress\fP events on its non-leaf windows within the first
343 30 seconds of their existence, but selects them later, then it is
344 possible that \fIxscreensaver\fP could interfere with the propagation
345 of those events. This isn't very likely, but this is the reason that
346 it's a good idea to install the \fIXIdle\fP extension.
348 Although this program ``nices'' the subprocesses that it starts,
349 graphics-intensive subprograms can still overload the machine by causing
350 the X server process itself (which is not ``niced'') to suck a lot of
351 cycles. Care should be taken to slow down programs intended for use as
352 screensavers by inserting strategic calls to
358 Also, it will cause your X server to be pretty much permanently swapped in.
359 (but the same is true of any program that draws periodically, like xclock or
362 If the subprocess is drawing too quickly and the connection to the X
363 server is a slow one (such as an X terminal running over a phone line) then
364 the screensaver might not turn off right away when the user becomes active
367 demo has this problem if being run in full-speed mode). This can be
368 alleviated by inserting strategic calls to
370 in code intended for use as a screensaver. This prevents too much graphics
371 activity from being buffered up.
373 The screensaver only runs on the default screen of the display. If you have
374 more than one screen, you must run multiple screensaver processes, one for
375 each screen. (I don't actually know whether this works, because I don't
376 have access to a multi-screen machine. Comments welcome.)
378 If you don't have Motif, you can't compile with support for locking or
381 When the \fBRun Next\fP and \fBRun Previous\fP buttons are used, the selected
382 item may not be visible in the window. It's a Motif bug that selecting a
383 different item doesn't scroll the list to show the new selected item.
385 Locking doesn't work if the screensaver is launched by \fIxdm\fP.
387 If you get an error message like ``couldn't get password of foo'' then
388 this probably means that you're on a system in which the
390 library routine can only be effectively used by root. If this is the case,
391 then \fIxscreensaver\fP must be installed as setuid to root. Care has
392 been taken to make this a safe thing to do.
394 There need to be a lot more graphics hacks. In particular, there should be
395 a simulation of a Lavalite (tm).
397 The \fBinstallColormap\fP option doesn't work very well with the
399 window manager and its descendants. There is a race condition between the
400 screensaver and this window manager, which can result in the screensaver's
401 colormap not getting installed properly, meaning the graphics hacks will
402 appear in essentially random colors. The
406 window managers don't seem to have this problem. The race condition exists
407 because X apparently does not provide a way for an OverrideRedirect window to
408 have its own colormap, short of grabbing the server (which is neither a good
409 idea, nor really possible with the current design.) What happens is that, as
410 soon as the screensaver installs its colormap, \fBtwm\fP responds to
411 the \fBColormapNotify\fP event that is generated by re-instaling the default
412 colormap. Apparently, \fBtwm\fP doesn't \fIalways\fP do this; it seems to do
413 it regularly if the screensaver is activated from a menu item, but seems to
414 not do it if the screensaver comes on of its own volition, or is activated
415 from another console. Any thoughts on this problem are welcome...
417 The \fBinstallColormap\fP option has no effect in "demo" mode, since the
418 dialog boxes allocate their colors out of the screen's default colormap
419 instead of the installed colormap.
421 For this same reason, locking doesn't work too well along
422 with \fBinstallColormap\fP; the dialog box's colors are random.
424 Apparently there are some problems with ``XView'' programs getting confused
425 and thinking that the screensaver window is the real root window even when
426 the screensaver is not active: ClientMessages intended for the window manager
427 are sent to the screensaver window instead. This could be solved by making
428 xscreensaver forward all unrecognised ClientMessages to the real root window,
429 but there may be other problems as well.
431 Copyright \(co 1992, 1993 by Jamie Zawinski. Permission to use, copy, modify,
432 distribute, and sell this software and its documentation for any purpose is
433 hereby granted without fee, provided that the above copyright notice appear
434 in all copies and that both that copyright notice and this permission notice
435 appear in supporting documentation. No representations are made about the
436 suitability of this software for any purpose. It is provided "as is" without
437 express or implied warranty.
439 Jamie Zawinski <jwz@lucid.com>, 13-aug-92.
440 Please let me know if you find any bugs or make any improvements.
442 Thanks to David Wojtowicz for implementing \fIlockTimeout\fP.
444 Thanks to Martin Kraemer for adding support for shadow passwords and
445 locking-disabled diagnostics.