1XScreenSaver(1) General Commands Manual XScreenSaver(1)
2
3
4
6 xscreensaver-command - control a running xscreensaver process
7
9 xscreensaver-command [--display host:display.screen] [--help | --quiet
10 | --verbose | --activate | --deactivate | --cycle | --next | --prev |
11 --select n | --lock | --suspend | --exit | --restart | --time | --watch
12 | --version]
13
15 The xscreensaver-command program controls a running xscreensaver(1)
16 daemon.
17
19 xscreensaver-command accepts the following command-line options:
20
21 --help Prints a brief summary of command-line options.
22
23 --quiet Only print output if an error occurs.
24
25 --verbose
26 Opposite of --quiet. Default.
27
28 --activate
29 Tell xscreensaver to turn on immediately (that is, blank the
30 screen, as if the user had been idle for long enough.) The
31 screensaver will deactivate as soon as there is any user activ‐
32 ity, as usual.
33
34 --deactivate
35 This tells xscreensaver to pretend that there has just been
36 user activity. This means that if the screensaver is active
37 (the screen is blanked), then this command will cause the
38 screen to un-blank as if there had been keyboard or mouse ac‐
39 tivity. If the screen is locked, then the password dialog will
40 pop up first, as usual. If the screen is not blanked, then
41 this simulated user activity will re-start the countdown (so,
42 issuing the --deactivate command periodically is one way to
43 prevent the screen from blanking.)
44
45 --cycle If the screensaver is active (the screen is blanked), then stop
46 the current graphics demo and run a new one (chosen randomly.)
47
48 --next This is like either --activate or --cycle, depending on which
49 is more appropriate, except that the graphics hack that will be
50 run is the next one in the list, instead of a randomly-chosen
51 one. In other words, repeatedly executing --next will cause
52 the xscreensaver process to invoke each graphics demo sequen‐
53 tially. (Though using the --settings option is probably an
54 easier way to accomplish that.)
55
56 --prev This is like --next, but cycles in the other direction.
57
58 --select number
59 Like --activate, but runs the Nth element in the list of hacks.
60 By knowing what is in the programs list, and in what order, you
61 can use this to activate the screensaver with a particular
62 graphics demo. (The first element in the list is numbered 1,
63 not 0.)
64
65 --lock Tells the running xscreensaver process to lock the screen imme‐
66 diately. This is like --activate, but forces locking as well,
67 even if locking is not the default (that is, even if xscreen‐
68 saver's lock resource is false, and even if the lockTimeout re‐
69 source is non-zero.)
70
71 Note that locking doesn't work unless the xscreensaver process
72 is running as you. See xscreensaver(1) for details.
73
74 --suspend
75 Like --activate, but ignores lockTimeout and immediately powers
76 off the screen without fading out. This is intended to be run
77 just after your laptop's lid is closed, and just before the CPU
78 halts, to lock things down quickly.
79
80 --exit Causes the xscreensaver process to exit gracefully. This does
81 nothing if the display is currently locked. Warning: never use
82 kill -9 with xscreensaver. That can leave things in an incon‐
83 sistent state, and you may need to log out to repair the dam‐
84 age.
85
86 --restart
87 Causes the screensaver process to exit and then restart with
88 the same command line arguments as last time. You shouldn't
89 really need to do this, since xscreensaver notices when the
90 .xscreensaver file has changed and re-reads it as needed.
91
92 --time Prints the time at which the screensaver last activated or de‐
93 activated (roughly, how long the user has been idle or non-
94 idle: but not quite, since it only tells you when the screen
95 became blanked or un-blanked.)
96
97 --watch Prints a line each time the screensaver changes state: when the
98 screen blanks, locks, unblanks, or when the running hack is
99 changed. This option never returns; it is intended for use by
100 shell scripts that want to react to the screensaver in some
101 way. An example of its output would be:
102
103 BLANK Fri Nov 5 01:57:22 1999
104 RUN 34
105 RUN 79
106 RUN 16
107 LOCK Fri Nov 5 01:57:22 1999
108 RUN 76
109 RUN 12
110 UNBLANK Fri Nov 5 02:05:59 1999
111
112 The above shows the screensaver activating, running three dif‐
113 ferent hacks, then locking (perhaps because the lock-timeout
114 went off) then unblanking (because the user became active, and
115 typed the correct password.) The hack numbers are their index
116 in the `programs' list (starting with 1, not 0, as for the
117 --select command.)
118
119 For example, suppose you want to run a program that turns down
120 the volume on your machine when the screen blanks, and turns it
121 back up when the screen un-blanks. You could do that by run‐
122 ning a Perl program like the following in the background. The
123 following program tracks the output of the --watch command and
124 reacts accordingly:
125
126 #!/usr/bin/perl
127
128 my $blanked = 0;
129 open (my $in, "xscreensaver-command -watch |") || die;
130 while (<$in>) {
131 if (m/^(BLANK|LOCK)/) {
132 if (!$blanked) {
133 system ("sound-off");
134 $blanked = 1;
135 }
136 } elsif (m/^UNBLANK/) {
137 system ("sound-on");
138 $blanked = 0;
139 }
140 }
141
142 Note that LOCK might come either with or without a preceding
143 BLANK (depending on whether the lock-timeout is non-zero), so
144 the above program keeps track of both of them.
145
146 --version
147 Prints the version of xscreensaver that is currently running on
148 the display: that is, the actual version number of the running
149 xscreensaver background process, rather than the version number
150 of xscreensaver-command. (To see the version number of
151 xscreensaver-command itself, use the --help option.)
152
154 If xscreensaver is running, but you want it to stop running screen
155 hacks (e.g., if you are logged in remotely, and you want the console to
156 remain locked but just be black, with no graphics processes running)
157 you can accomplish that by simply powering down the monitor remotely.
158 In a minute or so, xscreensaver will notice that the monitor is off,
159 and will stop running screen hacks. You can power off the monitor like
160 so:
161
162 xset dpms force off
163
164 See the xset(1) manual for more info.
165
166 You can also use xscreensaver-settings(1) to make the monitor power
167 down after a few hours, meaning that xscreensaver will run graphics un‐
168 til it has been idle for the length of time you specified; and after
169 that, the monitor will power off, and screen hacks will stop being run.
170
172 If an error occurs while communicating with the xscreensaver daemon, or
173 if the daemon reports an error, a diagnostic message will be printed to
174 stderr, and xscreensaver-command will exit with a non-zero value. If
175 the command is accepted, an indication of this will be printed to std‐
176 out, and the exit value will be zero.
177
179 DISPLAY to get the host and display number of the screen whose saver is
180 to be manipulated.
181
182 PATH to find the executable to restart (for the --restart command).
183 Note that this variable is consulted in the environment of the
184 xscreensaver process, not the xscreensaver-command process.
185
187 The latest version of xscreensaver(1) and related tools can always be
188 found at https://www.jwz.org/xscreensaver/
189
191 X(1), xscreensaver(1), xscreensaver-settings(1), xset(1)
192
194 Copyright © 1992-2022 by Jamie Zawinski. Permission to use, copy, mod‐
195 ify, distribute, and sell this software and its documentation for any
196 purpose is hereby granted without fee, provided that the above copy‐
197 right notice appear in all copies and that both that copyright notice
198 and this permission notice appear in supporting documentation. No rep‐
199 resentations are made about the suitability of this software for any
200 purpose. It is provided "as is" without express or implied warranty.
201
203 Jamie Zawinski <jwz@jwz.org>.
204
205 Please let me know if you find any bugs or make any improvements.
206
207
208
209X Version 11 6.06-1.fc37 (12-Dec-2022) XScreenSaver(1)