5e3b1fd01327be48c98943f7eb62e75e9a7ad471
[xscreensaver] / local / man / man.1 / xscreensaver-command.1
1 .de EX          \"Begin example
2 .ne 5
3 .if n .sp 1
4 .if t .sp .5
5 .nf
6 .in +.5i
7 ..
8 .de EE
9 .fi
10 .in -.5i
11 .if n .sp 1
12 .if t .sp .5
13 ..
14 .TH XScreenSaver 1 "20-Jun-99 (3.15)" "X Version 11"
15 .SH NAME
16 xscreensaver-command - control a running xscreensaver process
17 .SH SYNOPSIS
18 .B xscreensaver-command
19 [\-help] \
20 [\-demo] \
21 [\-prefs] \
22 [\-activate] \
23 [\-deactivate] \
24 [\-cycle] \
25 [\-next] \
26 [\-prev] \
27 [\-select \fIn\fP] \
28 [\-exit] \
29 [\-restart] \
30 [\-lock] \
31 [\-throttle] \
32 [\-unthrottle] \
33 [\-version] \
34 [\-time]
35 .SH DESCRIPTION
36 The \fIxscreensaver\-command\fP program controls a running \fIxscreensaver\fP
37 process by sending it client-messages.
38
39 .BR xscreensaver (1)
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).
44
45 This program, \fIxscreensaver-command\fP, is a command-line-oriented tool; the 
46 .BR xscreensaver\-demo (1).
47 program is a graphical tool.
48 .SH OPTIONS
49 .I xscreensaver-command
50 accepts the following command-line options:
51 .TP 8
52 .B \-help
53 Prints a brief summary of command-line options.
54 .TP 8
55 .B \-demo
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.
60 .TP 8
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)
67 communicates with the
68 .BR xscreensaver (1)
69 daemon.  (The first hack in the list is numbered 1, not 0.)
70 .TP 8
71 .B \-prefs
72 Like the no-argument form of \fI\-demo\fP, but brings up that program's
73 Preferences panel by default.
74 .TP 8
75 .B \-activate
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.
79
80 It is useful to run this from a menu; you may wish to run it as
81 .EX
82 sleep 5 ; xscreensaver-command -activate
83 .EE
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.)
87 .TP 8
88 .B \-deactivate
89 If the screensaver is active (the screen is blanked), this command will
90 deactivate it just as if there had been keyboard or mouse activity.  
91 If locking is enabled, then the screensaver will prompt for a password
92 as usual.
93 .TP 8
94 .B \-cycle
95 If the screensaver is active (the screen is blanked), then stop the current
96 graphics demo and run a new one (chosen randomly.)
97 .TP 8
98 .B \-next
99 This is like either \fI\-activate\fP or \fI\-cycle\fP, depending on which is
100 more appropriate, except that the graphics hack that will be run is the next
101 one in the list, instead of a randomly-chosen one.  In other words, 
102 repeatedly executing -next will cause the xscreensaver process to invoke each
103 graphics demo sequentially.  (Though using the \fI\-demo\fP option is probably
104 an easier way to accomplish that.)
105 .TP 8
106 .B \-prev
107 This is like \fI\-next\fP, but cycles in the other direction.
108 .TP 8
109 .B \-select \fInumber\fP
110 Like \fI\-activate\fP, but runs the \fIN\fPth element in the list of hacks.
111 By knowing what is in the \fIprograms\fP list, and in what order, you can use
112 this to activate the screensaver with a particular graphics demo.  (The first
113 element in the list is numbered 1, not 0.)
114 .TP 8
115 .B \-exit
116 Causes the xscreensaver process to exit gracefully.  This is roughly the same
117 as killing the process with
118 .BR kill (1),
119 but it is easier, since you don't need to first figure out the pid.  
120
121 .B Warning:
122 never use \fIkill -9\fP with \fIxscreensaver\fP while the screensaver is
123 active.  If you are using a virtual root window manager, that can leave
124 things in an inconsistent state, and you may need to restart your window
125 manager to repair the damage.
126 .TP 8
127 .B \-lock
128 Tells the running xscreensaver process to lock the screen immediately.  
129 This is like \fI\-activate\fP, but forces locking as well, even if locking
130 is not the default (that is, even if xscreensaver's \fIlock\fP resource is
131 false, and even if the \fIlockTimeout\fP resource is non-zero.)
132
133 Note that locking doesn't work unless the \fIxscreensaver\fP process is
134 running as you.  See 
135 .BR xscreensaver (1)
136 for details.
137 .TP 8
138 .B \-throttle
139 Temporarily switch to ``blank screen'' mode, and don't run any display modes
140 at all, until the screensaver is next de-activated.  This is useful if you're
141 using a machine remotely, and you find that some display modes are using too
142 much CPU.  
143
144 (If you want to do this \fIpermanently\fP, that is, you want the screen saver
145 to only blank the screen and not run demos at all, then set the \fIprograms\fP
146 resource to an empty list:  See
147 .BR xscreensaver (1)
148 for details.)
149 .TP 8
150 .B \-unthrottle
151 Turn `-throttle' mode off and resume normal behavior.
152 .TP 8
153 .B \-version
154 Prints the version of xscreensaver that is currently running on the display:
155 that is, the actual version number of the running xscreensaver background 
156 process, rather than the version number of xscreensaver-command.  (To see
157 the version number of \fIxscreensaver-command\fP itself, use 
158 the \fI\-help\fP option.)
159 .TP 8
160 .B \-time
161 Prints the time at which the screensaver last activated or 
162 deactivated (roughly, how long the user has been idle or non-idle: but 
163 not quite, since it only tells you when the screen became blanked or
164 un-blanked.)
165 .TP 8
166 .B \-restart
167 Causes the screensaver process to exit and then restart with the same command
168 line arguments as last time.  Do this after you've changed the resource
169 database, to cause xscreensaver to notice the changes.
170
171 .B Warning:
172 if you have a \fI.xscreensaver\fP file, this might not do what you 
173 expect.  You're probably better off killing the existing 
174 xscreensaver (with \fIxscreensaver\-command -exit\fP) and then
175 launching it again.
176
177 The important point is, you need to make sure that the xscreensaver 
178 process is running as you.  If it's not, it won't be reading the 
179 right \fI.xscreensaver\fP file.
180 .SH DIAGNOSTICS
181 If an error occurs while communicating with the \fIxscreensaver\fP daemon, or
182 if the daemon reports an error, a diagnostic message will be printed to
183 stderr, and \fIxscreensaver-command\fP will exit with a non-zero value.  If
184 the command is accepted, an indication of this will be printed to stdout, and
185 the exit value will be zero.
186 .SH ENVIRONMENT
187 .PP
188 .TP 8
189 .B DISPLAY
190 to get the host and display number of the screen whose saver is
191 to be manipulated.
192 .TP 8
193 .B PATH
194 to find the executable to restart (for the \fI\-restart\fP command).  
195 Note that this variable is consulted in the environment of 
196 the \fIxscreensaver\fP process, not the \fIxscreensaver-command\fP process.
197 .SH UPGRADES
198 The latest version of
199 .BR xscreensaver (1)
200 and related tools can always be found at http://www.jwz.org/xscreensaver/
201 .SH "SEE ALSO"
202 .BR X (1),
203 .BR xscreensaver (1)
204 .BR xscreensaver\-demo (1)
205 .SH COPYRIGHT
206 Copyright \(co 1992, 1993, 1997, 1998, 1999
207 by Jamie Zawinski.  Permission to use, copy, modify, distribute, and sell
208 this software and its documentation for any purpose is hereby granted without
209 fee, provided that the above copyright notice appear in all copies and that
210 both that copyright notice and this permission notice appear in supporting
211 documentation.  No representations are made about the suitability of this
212 software for any purpose.  It is provided "as is" without express or implied
213 warranty.
214 .SH AUTHOR
215 Jamie Zawinski <jwz@jwz.org>, 13-aug-92.
216
217 Please let me know if you find any bugs or make any improvements.