DISPLAY
to get the default host and display number.
Graphics hack and screen locker, launched when the user is idle
xscreensaver [-display
host:display.screen]
[-timeout
int]
[-cycle
int]
[-nice
int]
[-verbose]
[-silent]
[-lock]
[-no-lock]
[-lock-timeout
int]
[-demo]
[-visual
visual]
[-install]
[-no-install]
[-xidle-extension]
[-no-xidle-extension]
[-sgi-extension]
[-no-sgi-extension]
[-mit-extension]
[-no-mit-extension]
[-xrm
resources]
The xscreensaver program waits until the keyboard and mouse have been idle for a period, and then runs a graphics demo chosen at random. It turns off as soon as there is any mouse or keyboard activity.
This program can lock your terminal in order to prevent others from using it, though its default mode of operation is merely to display pretty pictures on your screen when it is not in use.
The benefit that this program has over the combination of the xlock(1) and xautolock(1) programs is the ease with which new graphics hacks can be installed. You don't need to recompile (or even re-run) this program to add a new display mode.
xscreensaver accepts the following options:
-timeout minutes
The screensaver will activate after the keyboard and mouse have been idle for this many minutes.
-cycle minutes
After the screensaver has been running for this many minutes, the currently running sub-process will be killed (with SIGTERM), and a new one started. If this is 0, then the sub-process will not be killed; only one demo will run until the screensaver is deactivated by user activity.
-nice integer
The sub-processes created by xscreensaver will be ``niced'' to this level, so that they do not consume cycles that are needed elsewhere.
-verbose
Print diagnostics.
-silent
-xidle-extension
Use the XIDLE server extension to decide whether the user is idle. This is the default if xscreensaver has been compiled with support for this extension. On X11R4 or X11R5 systems, the XIdle method is faster and more reliable than what will be done otherwise, so use it if you can.
-no-xidle-extension
Don't use the XIDLE server extension.
-sgi-extension
Use the SGI SCREEN_SAVER server extension to decide whether the user is idle. This is the default if xscreensaver has been compiled with support for this extension. On SGI systems, the SCREEN_SAVER method is faster and more reliable than what will be done otherwise, so use it if you can.
-no-sgi-extension
Don't use the SGI SCREEN_SAVER server extension.
-mit-extension
Use the MIT-SCREEN-SAVER server extension to decide whether the user is idle. This is the default if xscreensaver has been compiled with support for this extension. This extension is flaky, so it's use is not really recommended.
-no-mit-extension
Don't use the MIT-SCREEN-SAVER server extension.
-lock
Enable locking: before the screensaver will turn off, it requires you to type the password of the person who launched the screensaver, or the root password. (Note: this doesn't work if the screensaver is launched by xdm(1) because it can't know the user-id of the logged-in user.)
-no-lock
Disable locking. This is the default.
-lock-timeout minutes
This is how long after the screensaver activates that locking is enabled. For example, if this is 5, then any user activity within five minutes of the time when the screensaver activated will cause the screen to unblank without requiring a password. After 5 minutes, a password will be required. The default is 0, meaning that if locking is enabled, then a password will be required as soon as the screensaver activates.
-visual visual
Specify which visual to use. Legal values are:
bestUse the visual which supports the most writable color cells; this is the default.
defaultUse the screen's default visual (the visual of the root window.) This is not necessarily the most colorful visual, which is why it is not the default.
One of StaticGray, StaticColor, TrueColor, GrayScale, PseudoColor, or DirectColor. Selects the deepest visual of the given class.
A number (decimal or hex) is interpreted as a visual id number, as reported by the xdpyinfo(1) program; in this way you can select a shallower visual if desired.
-no-install
Use the default colormap. This is the default.
-install
Install a private colormap while the screensaver is on, so that the graphics hacks can get as many colors as possible.
-demo
Enter the interactive demo mode immediately after startup. Normally demo mode is invoked via the xscreensaver-command(1) program.
xscreensaver understands the following resources:
Same as the -timeout command-line option. Default 10 minutes.
Same as the -cycle command-line option. Default 10 minutes.
Same as the -nice command-line option. Default 10.
Same as the -verbose command-line option.
Same as the -xidle command-line option.
Same as the -lock command-line option.
Same as the -lock-timeout command-line option.
If this is true, then when the screensaver activates, the current contents of the screen will fade to black instead of simply winking out. This only works on displays with writable colormaps. Default true. A fade will also be done when switching graphics hacks (when the cycle timer expires.)
If this is true, then when the screensaver deactivates, the original contents of the screen will fade in from black instead of appearing immediately. This only works on displays with writable colormaps, and if fade is true as well. Default false.
If fade is true, this is how long the fade will be in seconds (default 1.)
If fade is true, this is how many times a second the colormap will be changed to effect a fade. Higher numbers yield smoother fades, but may make the fades take longer if your server isn't fast enough to keep up. Default 75.
Same as the -install command-line option. Default false.
If lock is true, this is how many seconds the password dialog box should be left on the screen before giving up (default 30.) This should not be too large: the X server is grabbed for the duration that the password dialog box is up (for security purposes) and leaving the server grabbed for too long can cause problems.
Same as the -visual command-line option. Default best.
Whether xscreensaver should redirect its standard-error stream to the window itself. Since its nature is to take over the screen, you would not normally see error messages generated by the screensaver or the programs it runs; this resource will cause the output of all relevant programs to be drawn on the screensaver window itself instead of written to the controlling terminal of the screensaver driver process. Default: True.
Like captureStderr but for the standard-output stream. Default: True.
The font used for the stdout/stderr text, if captureStdout or captureStderr are true. Default *-medium-r-*-140-*-m-* (a 14 point fixed-width font.)
The foreground color used for the stdout/stderr text, if captureStdout or captureStderr are true. Default: Yellow.
The background color used for the stdout/stderr text, if captureStdout or captureStderr are true. Default: Black.
The graphics hacks which xscreensaver runs when the user is idle, in addition to those specified in colorPrograms or monoPrograms (as appropriate.) The value of this resource is a string, one sh command per line. Each line must contain exactly one command -- no semicolons.
When the screensaver starts up, one of these is selected at random, and run. After the cycle period expires, it is killed, and another is selected and run.
If the value of this resource (and the applicable one of colorPrograms or monoPrograms) is empty, then no programs will be run; the screen will simply be made black.
Note that you must escape the newlines; here is an example of how you might set this in your .Xdefaults file:
xscreensaver.programs: \
qix -root \n\
ico -r -faces -sleep 1 -obj ico \n\
xdaliclock -builtin2 -root \n\
xwave -root
To use a program as a screensaver, two things are required: that that program draw on the root window (or be able to be configured to draw on the root window); and that that program understand ``virtual root'' windows, as used by virtual window managers such as tvtwm.
It is quite easy to make programs understand virtual roots if they don't already: you merely need to include the file "vroot.h" in them after the standard X includes, and recompile. This file is distributed with X11r5, and is included with xscreensaver as well.
This resource is appended to the value of the programs resource if the display on which the screensaver is running is monochrome.
This resource is appended to the value of the programs resource if the display on which the screensaver is running is not monochrome.
NOTE: this means that if you want to completely replace the list of programs which xscreensaver runs, you must set at least two, possibly three resources. It is not enough to just set the programs resource -- you must also set colorPrograms or monoPrograms or both.
Normally you won't need to change the following resources:
The pathname of the shell that xscreensaver uses to start subprocesses. This must be whatever your local variant of /bin/sh is -- in particular, it must not be csh.
When server extensions are not in use, this controls the delay between when windows are created and when xscreensaver selects events on them. Default 30 seconds.
When server extensions are not in use, this controls how frequently xscreensaver checks to see if the mouse position or buttons have changed. Default 5 seconds.
When server extensions are not in use, xscreensaver will wait this many seconds before selecting events on existing windows, under the assumption that xscreensaver is started during your login procedure, and the window state may be in flux. Default 30 seconds.
When it is time to activate the screensaver, a full-screen black window is created. This window is given the appropriate properties so that, to any subsequently-created programs, it will appear to be a ``virtual root'' window. Because of this, any program which draws on the root window (and which understands virtual roots) can be used as a screensaver.
When the user becomes active again, the screensaver window is unmapped and the running subprocess is killed by sending it SIGTERM. This is also how the subprocesses are killed when the screensaver decides that it's time to run a different demo: the old one is killed and a new one is launched.
Before launching a subprocess, xscreensaver stores an appropriate value for $DISPLAY in the environment that the child will recieve. (This is so that if you start xscreensaver with a -display argument, the programs which xscreensaver launches will draw on the same display.)
When the screensaver turns off, or is killed, care is taken to restore the ``real'' virtual root window if there is one. Because of this, it is important that you not kill the screensaver process with kill -9 if you are running a virtual-root window manager. If you kill it with -9, you may need to restart your window manager to repair the damage. This isn't an issue if you aren't running a virtual-root window manager.
For all the gory details, see the commentary at the top of xscreensaver.c.
You can control a running screensaver process by using the xscreensaver-command(1) program (which see.)
DISPLAY
to get the default host and display number.
XENVIRONMENT
to get the name of a resource file that overrides the global resources stored in the RESOURCE_MANAGER property.
You can run xscreensaver from your xdm session, so that the screensaver will run even when nobody is logged in on the console. Simply add "xscreensaver &" to your /usr/lib/X11/xdm/Xsetup file. Because xdm grabs the keyboard, keypresses will not make the screensaver deactivate, but any mouse activity will.
(If your system does not seem to be executing the Xsetup file, you may need to configure it to do so -- the traditional way to do this is to make that file the value of the DisplayManager*setup resource in the xdm-config file. See the man page for xdm(1) for more details.)
Users may want to add "xscreensaver-command -restart" to their startup scripts, so that the screensaver will be reinitialized with their private resource settings when they log in.
It is safe to run this program as root (as xdm is likely to do.) If run as root, xscreensaver changes its effective user and group ids to something safe (like "nobody") before connecting to the X server or launching user-specified programs.
Locking doesn't work if the screensaver is launched by xdm. To get around this, you can run the screensaver from xdm without locking, and kill and restart it from your personal X startup script to enable locking.
If xscreensaver receives the DEMO ClientMessage, it pops up a dialog box from which you can examine and experiment with the screensaver's client programs.
Clicking left on an element in the scrolling list will place the indicated program and its args in the text field to be edited. Edit the arguments and hit return to run the program with the parameters you have specified.
Double-clicking on an element in the scrolling list will run the indicated program immediately.
When a client program is launched, the dialog box is hidden. Clicking any mouse button will re-expose the dialog box (but will not kill the client program.)
Clicking this button will run the next program in the list after the currently-selected one, and will scroll around to the top when it reaches the bottom.
Opposite of Run Next; at the top, it scrolls around to the bottom.
This pops up a second dialog box, in which you have the option to interactively change most of the screensaver's operational parameters, such as its timeouts, and whether it should hack colormaps. Changing these parameters here will affect only the running xscreensaver process; to make the changes permanent, you need to edit your X resource file.
Returns to normal screensaver operation.
ReinitializeCauses the screensaver process to exit and then restart with the same command-line arguments. This causes the X resource database to be re-read. This is just like the -restart argument to xscreensaver-command(1) except that when executed from this button, the screensaver will automatically return to demo mode after restarting.
The latest version can always be found at http://www.netscape.com/people/jwz/. There is also usually an up-to-date copy at ftp://ftp.x.org/.
Unchanged in 2 releases since Debian 1.2 (Rex).