14 .TH XScreenSaver 1 "03-Jun-2001 (3.33)" "X Version 11"
16 xscreensaver-command - control a running xscreensaver process
18 .B xscreensaver-command
19 [\-display \fIhost:display.screen\fP] \
38 The \fIxscreensaver\-command\fP program controls a running \fIxscreensaver\fP
39 process by sending it client-messages.
42 has a client-server model: the xscreensaver process is a
43 daemon that runs in the background; it is controlled by other
44 foreground programs such as \fIxscreensaver-command\fP and
45 .BR xscreensaver\-demo (1).
47 This program, \fIxscreensaver-command\fP, is a command-line-oriented tool; the
48 .BR xscreensaver\-demo (1).
49 program is a graphical tool.
51 .I xscreensaver-command
52 accepts the following command-line options:
55 Prints a brief summary of command-line options.
58 This just launches the
59 .BR xscreensaver\-demo (1)
60 program, in which one can experiment with the various graphics hacks
61 available, and edit parameters.
63 .B \-demo \fP\fInumber\fP
64 When the \fI\-demo\fP option is followed by an integer, it instructs
65 the \fIxscreensaver\fP daemon to run that hack, and wait for the user
66 to click the mouse before deactivating (i.e., mouse motion does not
67 deactivate.) This is the mechanism by which
68 .BR xscreensaver\-demo (1)
71 daemon. (The first hack in the list is numbered 1, not 0.)
74 Like the no-argument form of \fI\-demo\fP, but brings up that program's
75 Preferences panel by default.
78 Tell xscreensaver to turn on immediately (that is, blank the screen, as if
79 the user had been idle for long enough.) The screensaver will deactivate as
80 soon as there is any user activity, as usual.
82 It is useful to run this from a menu; you may wish to run it as
84 sleep 5 ; xscreensaver-command -activate
86 to be sure that you have time to take your hand off the mouse before
87 the screensaver comes on. (Because if you jiggle the mouse, xscreensaver
88 will notice, and deactivate.)
91 If the screensaver is active (the screen is blanked), this command will
92 deactivate it just as if there had been keyboard or mouse activity.
93 If locking is enabled, then the screensaver will prompt for a password
97 If the screensaver is active (the screen is blanked), then stop the current
98 graphics demo and run a new one (chosen randomly.)
101 This is like either \fI\-activate\fP or \fI\-cycle\fP, depending on which is
102 more appropriate, except that the graphics hack that will be run is the next
103 one in the list, instead of a randomly-chosen one. In other words,
104 repeatedly executing -next will cause the xscreensaver process to invoke each
105 graphics demo sequentially. (Though using the \fI\-demo\fP option is probably
106 an easier way to accomplish that.)
109 This is like \fI\-next\fP, but cycles in the other direction.
111 .B \-select \fInumber\fP
112 Like \fI\-activate\fP, but runs the \fIN\fPth element in the list of hacks.
113 By knowing what is in the \fIprograms\fP list, and in what order, you can use
114 this to activate the screensaver with a particular graphics demo. (The first
115 element in the list is numbered 1, not 0.)
118 Causes the xscreensaver process to exit gracefully. This is roughly the same
119 as killing the process with
121 but it is easier, since you don't need to first figure out the pid.
124 never use \fIkill -9\fP with \fIxscreensaver\fP while the screensaver is
125 active. If you are using a virtual root window manager, that can leave
126 things in an inconsistent state, and you may need to restart your window
127 manager to repair the damage.
130 Tells the running xscreensaver process to lock the screen immediately.
131 This is like \fI\-activate\fP, but forces locking as well, even if locking
132 is not the default (that is, even if xscreensaver's \fIlock\fP resource is
133 false, and even if the \fIlockTimeout\fP resource is non-zero.)
135 Note that locking doesn't work unless the \fIxscreensaver\fP process is
141 Temporarily switch to ``blank screen'' mode, and don't run any display modes
142 at all, until the screensaver is next de-activated. This is useful if you're
143 using a machine remotely, and you find that some display modes are using too
146 (If you want to do this \fIpermanently\fP, that is, you want the screen saver
147 to only blank the screen and not run demos at all, then set the \fIprograms\fP
148 resource to an empty list: See
153 Turn `-throttle' mode off and resume normal behavior.
156 Prints the version of xscreensaver that is currently running on the display:
157 that is, the actual version number of the running xscreensaver background
158 process, rather than the version number of xscreensaver-command. (To see
159 the version number of \fIxscreensaver-command\fP itself, use
160 the \fI\-help\fP option.)
163 Prints the time at which the screensaver last activated or
164 deactivated (roughly, how long the user has been idle or non-idle: but
165 not quite, since it only tells you when the screen became blanked or
169 Causes the screensaver process to exit and then restart with the same command
170 line arguments as last time. Do this after you've changed the resource
171 database, to cause xscreensaver to notice the changes.
174 if you have a \fI.xscreensaver\fP file, this might not do what you
175 expect. You're probably better off killing the existing
176 xscreensaver (with \fIxscreensaver\-command -exit\fP) and then
179 The important point is, you need to make sure that the xscreensaver
180 process is running as you. If it's not, it won't be reading the
181 right \fI.xscreensaver\fP file.
184 Prints a line each time the screensaver changes state: when the screen
185 blanks, locks, unblanks, or when the running hack is changed. This option
186 never returns; it is intended for use by shell scripts that want to react to
187 the screensaver in some way. An example of its output would be:
189 BLANK Fri Nov 5 01:57:22 1999
193 LOCK Fri Nov 5 01:57:22 1999
196 UNBLANK Fri Nov 5 02:05:59 1999
198 The above shows the screensaver activating, running three different
199 hacks, then locking (perhaps because the lock-timeout went off) then
200 unblanking (because the user became active, and typed the correct
201 password.) The hack numbers are their index in the `programs'
202 list (starting with 1, not 0, as for the \fI\-select\fP command.)
204 For example, suppose you want to run a program that turns down the volume
205 on your machine when the screen blanks, and turns it back up when the screen
206 un-blanks. You could do that by running a Perl program like the following
207 in the background. The following program tracks the output of
208 the \fI\-watch\fP command and reacts accordingly:
213 open (IN, "xscreensaver-command -watch |");
215 if (m/^(BLANK|LOCK)/) {
220 } elsif (m/^UNBLANK/) {
226 Note that LOCK might come either with or without a preceeding BLANK
227 (depending on whether the lock-timeout is non-zero), so the above program
228 keeps track of both of them.
230 If an error occurs while communicating with the \fIxscreensaver\fP daemon, or
231 if the daemon reports an error, a diagnostic message will be printed to
232 stderr, and \fIxscreensaver-command\fP will exit with a non-zero value. If
233 the command is accepted, an indication of this will be printed to stdout, and
234 the exit value will be zero.
239 to get the host and display number of the screen whose saver is
243 to find the executable to restart (for the \fI\-restart\fP command).
244 Note that this variable is consulted in the environment of
245 the \fIxscreensaver\fP process, not the \fIxscreensaver-command\fP process.
247 The latest version of
249 and related tools can always be found at http://www.jwz.org/xscreensaver/
253 .BR xscreensaver\-demo (1)
255 Copyright \(co 1992, 1993, 1997, 1998, 1999, 2000, 2001
256 by Jamie Zawinski. Permission to use, copy, modify, distribute, and sell
257 this software and its documentation for any purpose is hereby granted without
258 fee, provided that the above copyright notice appear in all copies and that
259 both that copyright notice and this permission notice appear in supporting
260 documentation. No representations are made about the suitability of this
261 software for any purpose. It is provided "as is" without express or implied
264 Jamie Zawinski <jwz@jwz.org>, 13-aug-92.
266 Please let me know if you find any bugs or make any improvements.