ftp://ftp.ntnu.no/old/pub/X11/R5contrib/xscreensaver-1.17.tar.gz
[xscreensaver] / driver / xscreensaver.man
1 .de EX          \"Begin example
2 .ne 5
3 .if n .sp 1
4 .if t .sp .5
5 .nf
6 .in +.5i
7 ..
8 .de EE
9 .fi
10 .in -.5i
11 .if n .sp 1
12 .if t .sp .5
13 ..
14 .TH XScreenSaver 1 "22-mar-93" "X Version 11"
15 .SH NAME
16 xscreensaver - run graphics hacks after the user has been idle for a while
17 .SH SYNOPSIS
18 .B xscreensaver
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]
20 .SH DESCRIPTION
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.
24
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.  
28
29 The benefit that this program has over the combination of the
30 .BR xlock (1)
31 and
32 .BR xautolock (1)
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
35 mode.
36 .SH OPTIONS
37 .I xscreensaver
38 accepts the following options:
39 .TP 8
40 .B \-timeout \fIminutes\fP
41 The screensaver will activate after the keyboard and mouse have been idle
42 for this many minutes.
43 .TP 8
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.
49 .TP 8
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.
53 .TP 8
54 .B \-verbose
55 Print diagnostics.
56 .TP 8
57 .B \-silent
58
59 .TP 8
60 .B \-xidle
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.  
65 .TP 8
66 .B \-no\-xidle
67 Don't use \fIXIdle\fP.
68 .TP 8
69 .B \-lock
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
73 by
74 .BR xdm (1)
75 because it can't know the user-id of the logged-in user.)
76 .TP 8
77 .B \-no\-lock
78 Disable locking.  This is the default.
79 .TP 8
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.
87 .TP 8
88 .B \-demo
89 Enter the interactive demo mode immediately after startup.  Normally
90 demo mode is invoked via the
91 .BR xscreensaver\-command (1)
92 program.
93 .SH X RESOURCES
94 \fIxscreensaver\fP understands the following resources:
95 .PP
96 .TP 8
97 .B timeout \fR(class \fBTime\fP)
98 Same as the \fI\-timeout\fP command-line option.  Default 10 minutes.
99 .TP 8
100 .B cycle \fR(class \fBTime\fP)
101 Same as the \fI\-cycle\fP command-line option.  Default 10 minutes.
102 .TP 8
103 .B nice \fR(class \fBNice\fP)
104 Same as the \fI\-nice\fP command-line option.  Default 10.
105 .TP 8
106 .B verbose \fR(class \fBBoolean\fP)
107 Same as the \fI\-verbose\fP command-line option.
108 .TP 8
109 .B xidle \fR(class \fBBoolean\fP)
110 Same as the \fI\-xidle\fP command-line option.
111 .TP 8
112 .B lock \fR(class \fBBoolean\fP)
113 Same as the \fI\-lock\fP command-line option.
114 .TP 8
115 .B lockTimeout \fR(class \fBTime\fP)
116 Same as the \fI\-lock\-timeout\fP command-line option.
117 .TP 8
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.)
123 .TP 8
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.
129 .TP 8
130 .B fadeSeconds \fR(class \fBTime\fP)
131 If \fIfade\fP is true, this is how long the fade will be in 
132 seconds (default 1.)
133 .TP 8
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
138 up.  Default 75.
139 .TP 8
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
143 false.
144 .TP 8
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.
151 .TP 8
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.
156
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
159 is selected and run.
160
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.
164
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:
167 .EX
168 xscreensaver.programs:  \\
169         qix -root                        \\n\\
170         ico -r -faces -sleep 1 -obj ico  \\n\\
171         xdaliclock -builtin2 -root       \\n\\
172         xwave -root
173 .EE
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.
178
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.
183 .TP 8
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.
187 .TP 8
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.
191 .PP
192 Normally you won't need to change the following resources:
193 .TP 8
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.
198 .TP 8
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.
202 Default 30 seconds.
203 .TP 8
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.
207 .TP 8
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.
213 .SH "HOW IT WORKS"
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.
219 .PP
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.
224 .PP
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.)
229 .PP
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.
236 .PP
237 For all the gory details, see the commentary at the top of xscreensaver.c.
238 .PP
239 You can control a running screensaver process by using the
240 .BR xscreensaver\-command (1)
241 program (which see.)
242 .SH ENVIRONMENT
243 .PP
244 .TP 8
245 .B DISPLAY
246 to get the default host and display number.
247 .TP 8
248 .B XENVIRONMENT
249 to get the name of a resource file that overrides the global resources
250 stored in the RESOURCE_MANAGER property.
251 .SH USING XDM(1)
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.
257 .PP
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.
261 .PP
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.
266 .PP
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
270 locking.
271 .SH DEMO MODE
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
274 client programs.
275 .PP
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.
279 .PP
280 Double-clicking on an element in the scrolling list will run the indicated
281 program immediately.
282 .PP
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 
285 client program.)
286 .TP 8
287 .B Run Next
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
290 the bottom.
291 .TP 8
292 .B Run Previous
293 Opposite of Run Next; at the top, it scrolls around to the bottom.
294 .TP 8
295 .B Edit Parameters
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
301 file.
302 .TP 8
303 .B Exit Demo Mode
304 Returns to normal screensaver operation.
305 .TP 8
306 .B Reinitialize
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.
313 .SH SEE ALSO
314 .BR X (1),
315 .BR xscreensaver\-command (1),
316 .BR xlock (1),
317 .BR xnlock (1),
318 .BR xautolock (1),
319 .BR xdm (1),
320 .BR qix (1),
321 .BR pyro (1),
322 .BR helix (1),
323 .BR rorschach (1),
324 .BR hopalong (1),
325 .BR attraction (1),
326 .BR greynetic (1),
327 .BR rocks (1),
328 .BR noseguy (1),
329 .BR blitspin (1),
330 .BR imsmap (1),
331 .BR slidescreen (1),
332 .BR hypercube (1),
333 .BR maze (1),
334 .BR ico (1),
335 .BR xdaliclock (1),
336 .BR xbouncebits (1),
337 .BR xswarm (1),
338 .BR xwave (1),
339 .BR xfishtank (1)
340 .SH BUGS
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.
347 .PP
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
353 .BR sleep (3)
354 or
355 .BR usleep (3)
356 \.
357
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
360 xload.)
361 .PP
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
365 again (the
366 .BR ico (1)
367 demo has this problem if being run in full-speed mode).  This can be
368 alleviated by inserting strategic calls to
369 .BR XSync (3)
370 in code intended for use as a screensaver.  This prevents too much graphics
371 activity from being buffered up.
372 .PP
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.)
377 .PP
378 If you don't have Motif, you can't compile with support for locking or
379 demo mode.
380 .PP
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.
384 .PP
385 Locking doesn't work if the screensaver is launched by \fIxdm\fP.
386 .PP
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
389 .BR getpwent (3)
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.
393 .PP
394 There need to be a lot more graphics hacks.  In particular, there should be
395 a simulation of a Lavalite (tm).
396 .PP
397 The \fBinstallColormap\fP option doesn't work very well with the
398 .BR twm (1)
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
403 .BR mwm (1)
404 and
405 .BR olwm (1)
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...
416 .PP
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.
420 .PP
421 For this same reason, locking doesn't work too well along 
422 with \fBinstallColormap\fP; the dialog box's colors are random.
423 .PP
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.
430 .SH COPYRIGHT
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.
438 .SH AUTHOR
439 Jamie Zawinski <jwz@lucid.com>, 13-aug-92.
440 Please let me know if you find any bugs or make any improvements.
441
442 Thanks to David Wojtowicz for implementing \fIlockTimeout\fP.