14 .TH XScreenSaver 1 "23-Jun-2003 (4.11)" "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 This tells xscreensaver to pretend that there has just been user activity.
92 This means that if the screensaver is active (the screen is blanked),
93 then this command will cause the screen to un-blank as if there had been
94 keyboard or mouse activity. If the screen is locked, then the password
95 dialog will pop up first, as usual. If the screen is not blanked, then
96 this simulated user activity will re-start the countdown (so, issuing
97 the \fI\-deactivate\fP command periodically is \fIone\fP way to prevent
98 the screen from blanking.)
101 If the screensaver is active (the screen is blanked), then stop the current
102 graphics demo and run a new one (chosen randomly.)
105 This is like either \fI\-activate\fP or \fI\-cycle\fP, depending on which is
106 more appropriate, except that the graphics hack that will be run is the next
107 one in the list, instead of a randomly-chosen one. In other words,
108 repeatedly executing -next will cause the xscreensaver process to invoke each
109 graphics demo sequentially. (Though using the \fI\-demo\fP option is probably
110 an easier way to accomplish that.)
113 This is like \fI\-next\fP, but cycles in the other direction.
115 .B \-select \fInumber\fP
116 Like \fI\-activate\fP, but runs the \fIN\fPth element in the list of hacks.
117 By knowing what is in the \fIprograms\fP list, and in what order, you can use
118 this to activate the screensaver with a particular graphics demo. (The first
119 element in the list is numbered 1, not 0.)
122 Causes the xscreensaver process to exit gracefully. This is roughly the same
123 as killing the process with
125 but it is easier, since you don't need to first figure out the pid.
128 never use \fIkill -9\fP with \fIxscreensaver\fP while the screensaver is
129 active. If you are using a virtual root window manager, that can leave
130 things in an inconsistent state, and you may need to restart your window
131 manager to repair the damage.
134 Tells the running xscreensaver process to lock the screen immediately.
135 This is like \fI\-activate\fP, but forces locking as well, even if locking
136 is not the default (that is, even if xscreensaver's \fIlock\fP resource is
137 false, and even if the \fIlockTimeout\fP resource is non-zero.)
139 Note that locking doesn't work unless the \fIxscreensaver\fP process is
145 Temporarily switch to ``blank screen'' mode, and don't run any display modes
146 at all, until the screensaver is next de-activated. This is useful if you're
147 using a machine remotely, and you find that some display modes are using too
150 (If you want to do this \fIpermanently\fP, that is, you want the screen saver
151 to only blank the screen and not run demos at all, then set the \fIprograms\fP
152 resource to an empty list: See
157 Turn `-throttle' mode off and resume normal behavior.
160 Prints the version of xscreensaver that is currently running on the display:
161 that is, the actual version number of the running xscreensaver background
162 process, rather than the version number of xscreensaver-command. (To see
163 the version number of \fIxscreensaver-command\fP itself, use
164 the \fI\-help\fP option.)
167 Prints the time at which the screensaver last activated or
168 deactivated (roughly, how long the user has been idle or non-idle: but
169 not quite, since it only tells you when the screen became blanked or
173 Causes the screensaver process to exit and then restart with the same command
174 line arguments as last time. Do this after you've changed the resource
175 database, to cause xscreensaver to notice the changes.
178 if you have a \fI.xscreensaver\fP file, this might not do what you
179 expect. You're probably better off killing the existing
180 xscreensaver (with \fIxscreensaver\-command -exit\fP) and then
183 The important point is, you need to make sure that the xscreensaver
184 process is running as you. If it's not, it won't be reading the
185 right \fI.xscreensaver\fP file.
188 Prints a line each time the screensaver changes state: when the screen
189 blanks, locks, unblanks, or when the running hack is changed. This option
190 never returns; it is intended for use by shell scripts that want to react to
191 the screensaver in some way. An example of its output would be:
193 BLANK Fri Nov 5 01:57:22 1999
197 LOCK Fri Nov 5 01:57:22 1999
200 UNBLANK Fri Nov 5 02:05:59 1999
202 The above shows the screensaver activating, running three different
203 hacks, then locking (perhaps because the lock-timeout went off) then
204 unblanking (because the user became active, and typed the correct
205 password.) The hack numbers are their index in the `programs'
206 list (starting with 1, not 0, as for the \fI\-select\fP command.)
208 For example, suppose you want to run a program that turns down the volume
209 on your machine when the screen blanks, and turns it back up when the screen
210 un-blanks. You could do that by running a Perl program like the following
211 in the background. The following program tracks the output of
212 the \fI\-watch\fP command and reacts accordingly:
217 open (IN, "xscreensaver-command -watch |");
219 if (m/^(BLANK|LOCK)/) {
224 } elsif (m/^UNBLANK/) {
230 Note that LOCK might come either with or without a preceeding BLANK
231 (depending on whether the lock-timeout is non-zero), so the above program
232 keeps track of both of them.
234 If an error occurs while communicating with the \fIxscreensaver\fP daemon, or
235 if the daemon reports an error, a diagnostic message will be printed to
236 stderr, and \fIxscreensaver-command\fP will exit with a non-zero value. If
237 the command is accepted, an indication of this will be printed to stdout, and
238 the exit value will be zero.
243 to get the host and display number of the screen whose saver is
247 to find the executable to restart (for the \fI\-restart\fP command).
248 Note that this variable is consulted in the environment of
249 the \fIxscreensaver\fP process, not the \fIxscreensaver-command\fP process.
251 The latest version of
253 and related tools can always be found at http://www.jwz.org/xscreensaver/
257 .BR xscreensaver\-demo (1)
259 Copyright \(co 1992, 1993, 1997, 1998, 1999, 2000, 2001, 2002
260 by Jamie Zawinski. Permission to use, copy, modify, distribute, and sell
261 this software and its documentation for any purpose is hereby granted without
262 fee, provided that the above copyright notice appear in all copies and that
263 both that copyright notice and this permission notice appear in supporting
264 documentation. No representations are made about the suitability of this
265 software for any purpose. It is provided "as is" without express or implied
268 Jamie Zawinski <jwz@jwz.org>, 13-aug-92.
270 Please let me know if you find any bugs or make any improvements.