http://ftp.x.org/contrib/applications/xscreensaver-3.10.tar.gz
[xscreensaver] / driver / xscreensaver-command.man
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 "27-Apr-99 (3.10)" "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 [\-version] \
32 [\-time]
33 .SH DESCRIPTION
34 The \fIxscreensaver\-command\fP program controls a running \fIxscreensaver\fP
35 process by sending it client-messages.
36
37 .BR xscreensaver (1)
38 has a client-server model: the xscreensaver process is a
39 daemon that runs in the background; it is controlled by other
40 foreground programs such as \fIxscreensaver-command\fP and
41 .BR xscreensaver\-demo (1).
42
43 This program, \fIxscreensaver-command\fP, is a command-line-oriented tool; the 
44 .BR xscreensaver\-demo (1).
45 program is a graphical tool.
46 .SH OPTIONS
47 .I xscreensaver-command
48 accepts the following command-line options:
49 .TP 8
50 .B \-help
51 Prints a brief summary of command-line options.
52 .TP 8
53 .B \-demo
54 This just launches the
55 .BR xscreensaver\-demo (1)
56 program, in which one can experiment with the various graphics hacks
57 available, and edit parameters.
58 .TP 8
59 .B \-demo \fP\fInumber\fP
60 When the \fI\-demo\fP option is followed by an integer, it instructs 
61 the \fIxscreensaver\fP daemon to run that hack, and wait for the user
62 to click the mouse before deactivating (i.e., mouse motion does not
63 deactivate.)  This is the mechanism by which
64 .BR xscreensaver\-demo (1)
65 communicates with the
66 .BR xscreensaver (1)
67 daemon.  (The first hack in the list is numbered 1, not 0.)
68 .TP 8
69 .B \-prefs
70 Like the no-argument form of \fI\-demo\fP, but brings up that program's
71 Preferences panel by default.
72 .TP 8
73 .B \-activate
74 Tell xscreensaver to turn on immediately (that is, blank the screen, as if
75 the user had been idle for long enough.)  The screensaver will deactivate as
76 soon as there is any user activity, as usual.
77
78 It is useful to run this from a menu; you may wish to run it as
79 .EX
80 sleep 5 ; xscreensaver-command -activate
81 .EE
82 to be sure that you have time to take your hand off the mouse before
83 the screensaver comes on.  (Because if you jiggle the mouse, xscreensaver
84 will notice, and deactivate.)
85 .TP 8
86 .B \-deactivate
87 If the screensaver is active (the screen is blanked), this command will
88 deactivate it just as if there had been keyboard or mouse activity.  
89 If locking is enabled, then the screensaver will prompt for a password
90 as usual.
91 .TP 8
92 .B \-cycle
93 If the screensaver is active (the screen is blanked), then stop the current
94 graphics demo and run a new one (chosen randomly.)
95 .TP 8
96 .B \-next
97 This is like either \fI\-activate\fP or \fI\-cycle\fP, depending on which is
98 more appropriate, except that the graphics hack that will be run is the next
99 one in the list, instead of a randomly-chosen one.  In other words, 
100 repeatedly executing -next will cause the xscreensaver process to invoke each
101 graphics demo sequentially.  (Though using the \fI\-demo\fP option is probably
102 an easier way to accomplish that.)
103 .TP 8
104 .B \-prev
105 This is like \fI\-next\fP, but cycles in the other direction.
106 .TP 8
107 .B \-select \fInumber\fP
108 Like \fI\-activate\fP, but runs the \fIN\fPth element in the list of hacks.
109 By knowing what is in the \fIprograms\fP list, and in what order, you can use
110 this to activate the screensaver with a particular graphics demo.  (The first
111 element in the list is numbered 1, not 0.)
112 .TP 8
113 .B \-exit
114 Causes the xscreensaver process to exit gracefully.  This is roughly the same
115 as killing the process with
116 .BR kill (1),
117 but it is easier, since you don't need to first figure out the pid.  
118
119 .B Warning:
120 never use \fIkill -9\fP with \fIxscreensaver\fP while the screensaver is
121 active.  If you are using a virtual root window manager, that can leave
122 things in an inconsistent state, and you may need to restart your window
123 manager to repair the damage.
124 .TP 8
125 .B \-lock
126 Tells the running xscreensaver process to lock the screen immediately.  
127 This is like \fI\-activate\fP, but forces locking as well, even if locking
128 is not the default (that is, even if xscreensaver's \fIlock\fP resource is
129 false, and even if the \fIlockTimeout\fP resource is non-zero.)
130
131 Note that locking doesn't work unless the \fIxscreensaver\fP process is
132 running as you.  See 
133 .BR xscreensaver (1)
134 for details.
135 .TP 8
136 .B \-version
137 Prints the version of xscreensaver that is currently running on the display:
138 that is, the actual version number of the running xscreensaver background 
139 process, rather than the version number of xscreensaver-command.  (To see
140 the version number of \fIxscreensaver-command\fP itself, use 
141 the \fI\-help\fP option.)
142 .TP 8
143 .B \-time
144 Prints the time at which the screensaver last activated or 
145 deactivated (roughly, how long the user has been idle or non-idle: but 
146 not quite, since it only tells you when the screen became blanked or
147 un-blanked.)
148 .TP 8
149 .B \-restart
150 Causes the screensaver process to exit and then restart with the same command
151 line arguments as last time.  Do this after you've changed the resource
152 database, to cause xscreensaver to notice the changes.
153
154 .B Warning:
155 if you have a \fI.xscreensaver\fP file, this might not do what you 
156 expect.  You're probably better off killing the existing 
157 xscreensaver (with \fIxscreensaver\-command -exit\fP) and then
158 launching it again.
159
160 The important point is, you need to make sure that the xscreensaver 
161 process is running as you.  If it's not, it won't be reading the 
162 right \fI.xscreensaver\fP file.
163 .SH DIAGNOSTICS
164 If an error occurs while communicating with the \fIxscreensaver\fP daemon, or
165 if the daemon reports an error, a diagnostic message will be printed to
166 stderr, and \fIxscreensaver-command\fP will exit with a non-zero value.  If
167 the command is accepted, an indication of this will be printed to stdout, and
168 the exit value will be zero.
169 .SH ENVIRONMENT
170 .PP
171 .TP 8
172 .B DISPLAY
173 to get the host and display number of the screen whose saver is
174 to be manipulated.
175 .TP 8
176 .B PATH
177 to find the executable to restart (for the \fI\-restart\fP command).  
178 Note that this variable is consulted in the environment of 
179 the \fIxscreensaver\fP process, not the \fIxscreensaver-command\fP process.
180 .SH UPGRADES
181 The latest version of
182 .BR xscreensaver (1)
183 and related tools can always be found at http://www.jwz.org/xscreensaver/
184 .SH "SEE ALSO"
185 .BR X (1),
186 .BR xscreensaver (1)
187 .BR xscreensaver\-demo (1)
188 .SH COPYRIGHT
189 Copyright \(co 1992, 1993, 1997, 1998, 1999
190 by Jamie Zawinski.  Permission to use, copy, modify, distribute, and sell
191 this software and its documentation for any purpose is hereby granted without
192 fee, provided that the above copyright notice appear in all copies and that
193 both that copyright notice and this permission notice appear in supporting
194 documentation.  No representations are made about the suitability of this
195 software for any purpose.  It is provided "as is" without express or implied
196 warranty.
197 .SH AUTHOR
198 Jamie Zawinski <jwz@jwz.org>, 13-aug-92.
199
200 Please let me know if you find any bugs or make any improvements.