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