14 .TH XScreenSaver 1 "20-Mar-2005 (4.21)" "X Version 11"
16 xscreensaver-command - control a running xscreensaver process
18 .B xscreensaver-command
19 [\-display \fIhost:display.screen\fP] \
36 The \fIxscreensaver\-command\fP program controls a running \fIxscreensaver\fP
37 process by sending it client-messages.
40 has a client-server model: the xscreensaver process is a
41 daemon that runs in the background; it is controlled by other
42 foreground programs such as \fIxscreensaver-command\fP and
43 .BR xscreensaver\-demo (1).
45 This program, \fIxscreensaver-command\fP, is a command-line-oriented tool; the
46 .BR xscreensaver\-demo (1).
47 program is a graphical tool.
49 .I xscreensaver-command
50 accepts the following command-line options:
53 Prints a brief summary of command-line options.
56 This just launches the
57 .BR xscreensaver\-demo (1)
58 program, in which one can experiment with the various graphics hacks
59 available, and edit parameters.
61 .B \-demo \fP\fInumber\fP
62 When the \fI\-demo\fP option is followed by an integer, it instructs
63 the \fIxscreensaver\fP daemon to run that hack, and wait for the user
64 to click the mouse before deactivating (i.e., mouse motion does not
65 deactivate.) This is the mechanism by which
66 .BR xscreensaver\-demo (1)
69 daemon. (The first hack in the list is numbered 1, not 0.)
72 Like the no-argument form of \fI\-demo\fP, but brings up that program's
73 Preferences panel by default.
76 Tell xscreensaver to turn on immediately (that is, blank the screen, as if
77 the user had been idle for long enough.) The screensaver will deactivate as
78 soon as there is any user activity, as usual.
80 It is useful to run this from a menu; you may wish to run it as
82 sleep 5 ; xscreensaver-command -activate
84 to be sure that you have time to take your hand off the mouse before
85 the screensaver comes on. (Because if you jiggle the mouse, xscreensaver
86 will notice, and deactivate.)
89 This tells xscreensaver to pretend that there has just been user activity.
90 This means that if the screensaver is active (the screen is blanked),
91 then this command will cause the screen to un-blank as if there had been
92 keyboard or mouse activity. If the screen is locked, then the password
93 dialog will pop up first, as usual. If the screen is not blanked, then
94 this simulated user activity will re-start the countdown (so, issuing
95 the \fI\-deactivate\fP command periodically is \fIone\fP way to prevent
96 the screen from blanking.)
99 If the screensaver is active (the screen is blanked), then stop the current
100 graphics demo and run a new one (chosen randomly.)
103 This is like either \fI\-activate\fP or \fI\-cycle\fP, depending on which is
104 more appropriate, except that the graphics hack that will be run is the next
105 one in the list, instead of a randomly-chosen one. In other words,
106 repeatedly executing -next will cause the xscreensaver process to invoke each
107 graphics demo sequentially. (Though using the \fI\-demo\fP option is probably
108 an easier way to accomplish that.)
111 This is like \fI\-next\fP, but cycles in the other direction.
113 .B \-select \fInumber\fP
114 Like \fI\-activate\fP, but runs the \fIN\fPth element in the list of hacks.
115 By knowing what is in the \fIprograms\fP list, and in what order, you can use
116 this to activate the screensaver with a particular graphics demo. (The first
117 element in the list is numbered 1, not 0.)
120 Causes the xscreensaver process to exit gracefully.
121 This does nothing if the display is currently locked.
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 Prints the version of xscreensaver that is currently running on the display:
142 that is, the actual version number of the running xscreensaver background
143 process, rather than the version number of xscreensaver-command. (To see
144 the version number of \fIxscreensaver-command\fP itself, use
145 the \fI\-help\fP option.)
148 Prints the time at which the screensaver last activated or
149 deactivated (roughly, how long the user has been idle or non-idle: but
150 not quite, since it only tells you when the screen became blanked or
154 Causes the screensaver process to exit and then restart with the same command
155 line arguments as last time. You shouldn't really need to do this,
156 since xscreensaver notices when the \fI.xscreensaver\fP file has
157 changed and re-reads it as needed.
160 Prints a line each time the screensaver changes state: when the screen
161 blanks, locks, unblanks, or when the running hack is changed. This option
162 never returns; it is intended for use by shell scripts that want to react to
163 the screensaver in some way. An example of its output would be:
165 BLANK Fri Nov 5 01:57:22 1999
169 LOCK Fri Nov 5 01:57:22 1999
172 UNBLANK Fri Nov 5 02:05:59 1999
174 The above shows the screensaver activating, running three different
175 hacks, then locking (perhaps because the lock-timeout went off) then
176 unblanking (because the user became active, and typed the correct
177 password.) The hack numbers are their index in the `programs'
178 list (starting with 1, not 0, as for the \fI\-select\fP command.)
180 For example, suppose you want to run a program that turns down the volume
181 on your machine when the screen blanks, and turns it back up when the screen
182 un-blanks. You could do that by running a Perl program like the following
183 in the background. The following program tracks the output of
184 the \fI\-watch\fP command and reacts accordingly:
189 open (IN, "xscreensaver-command -watch |");
191 if (m/^(BLANK|LOCK)/) {
196 } elsif (m/^UNBLANK/) {
202 Note that LOCK might come either with or without a preceding BLANK
203 (depending on whether the lock-timeout is non-zero), so the above program
204 keeps track of both of them.
205 .SH STOPPING GRAPHICS
206 If xscreensaver is running, but you want it to stop running screen hacks
207 (e.g., if you are logged in remotely, and you want the console to remain
208 locked but just be black, with no graphics processes running) you can
209 accomplish that by simply powering down the monitor remotely. In a
210 minute or so, xscreensaver will notice that the monitor is off, and
211 will stop running screen hacks. You can power off the monitor like so:
217 manual for more info.
220 .BR xscreensaver-demo (1)
221 to make the monitor power down after a few hours, meaning that xscreensaver
222 will run graphics until it has been idle for the length of time you
223 specified; and after that, the monitor will power off, and screen hacks
226 If an error occurs while communicating with the \fIxscreensaver\fP daemon, or
227 if the daemon reports an error, a diagnostic message will be printed to
228 stderr, and \fIxscreensaver-command\fP will exit with a non-zero value. If
229 the command is accepted, an indication of this will be printed to stdout, and
230 the exit value will be zero.
235 to get the host and display number of the screen whose saver is
239 to find the executable to restart (for the \fI\-restart\fP command).
240 Note that this variable is consulted in the environment of
241 the \fIxscreensaver\fP process, not the \fIxscreensaver-command\fP process.
243 The latest version of
245 and related tools can always be found at http://www.jwz.org/xscreensaver/
248 .BR xscreensaver (1),
249 .BR xscreensaver\-demo (1),
252 Copyright \(co 1992, 1993, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
253 by Jamie Zawinski. Permission to use, copy, modify, distribute, and sell
254 this software and its documentation for any purpose is hereby granted without
255 fee, provided that the above copyright notice appear in all copies and that
256 both that copyright notice and this permission notice appear in supporting
257 documentation. No representations are made about the suitability of this
258 software for any purpose. It is provided "as is" without express or implied
261 Jamie Zawinski <jwz@jwz.org>, 13-aug-92.
263 Please let me know if you find any bugs or make any improvements.