1XScreenSaver(1)             General Commands Manual            XScreenSaver(1)
2
3
4

NAME

6       xscreensaver-command - control a running xscreensaver process
7

SYNOPSIS

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

DESCRIPTION

15       The xscreensaver-command program  controls  a  running  xscreensaver(1)
16       daemon.
17

OPTIONS

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 the
52               xscreensaver process to invoke each graphics demo sequentially.
53               (Though using the --settings option is probably an  easier  way
54               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 while the screensaver is active.  If
83               you are using a virtual root window  manager,  that  can  leave
84               things  in  an  inconsistent state, and you may need to restart
85               your window manager to repair the damage.
86
87       --restart
88               Causes the screensaver process to exit and  then  restart  with
89               the  same  command  line arguments as last time.  You shouldn't
90               really need to do this, since  xscreensaver  notices  when  the
91               .xscreensaver file has changed and re-reads it as needed.
92
93       --time  Prints  the time at which the screensaver last activated or de‐
94               activated (roughly, how long the user has  been  idle  or  non-
95               idle:  but  not  quite, since it only tells you when the screen
96               became blanked or un-blanked.)
97
98       --watch Prints a line each time the screensaver changes state: when the
99               screen  blanks,  locks,  unblanks,  or when the running hack is
100               changed.  This option never returns; it is intended for use  by
101               shell  scripts  that  want  to react to the screensaver in some
102               way.  An example of its output would be:
103
104                    BLANK Fri Nov  5 01:57:22 1999
105                    RUN 34
106                    RUN 79
107                    RUN 16
108                    LOCK Fri Nov  5 01:57:22 1999
109                    RUN 76
110                    RUN 12
111                    UNBLANK Fri Nov  5 02:05:59 1999
112
113               The above shows the screensaver activating, running three  dif‐
114               ferent  hacks,  then  locking (perhaps because the lock-timeout
115               went off) then unblanking (because the user became active,  and
116               typed  the correct password.)  The hack numbers are their index
117               in the `programs' list (starting with 1,  not  0,  as  for  the
118               --select command.)
119
120               For  example, suppose you want to run a program that turns down
121               the volume on your machine when the screen blanks, and turns it
122               back  up  when the screen un-blanks.  You could do that by run‐
123               ning a Perl program like the following in the background.   The
124               following  program tracks the output of the --watch command and
125               reacts accordingly:
126
127                    #!/usr/bin/perl
128
129                    my $blanked = 0;
130                    open (my $in, "xscreensaver-command -watch |") || die;
131                    while (<$in>) {
132                      if (m/^(BLANK|LOCK)/) {
133                        if (!$blanked) {
134                          system ("sound-off");
135                          $blanked = 1;
136                        }
137                      } elsif (m/^UNBLANK/) {
138                        system ("sound-on");
139                        $blanked = 0;
140                      }
141                    }
142
143               Note that LOCK might come either with or  without  a  preceding
144               BLANK  (depending  on whether the lock-timeout is non-zero), so
145               the above program keeps track of both of them.
146
147       --version
148               Prints the version of xscreensaver that is currently running on
149               the  display: that is, the actual version number of the running
150               xscreensaver background process, rather than the version number
151               of   xscreensaver-command.   (To  see  the  version  number  of
152               xscreensaver-command itself, use the --help option.)
153

STOPPING GRAPHICS

155       If xscreensaver is running, but you want  it  to  stop  running  screen
156       hacks (e.g., if you are logged in remotely, and you want the console to
157       remain locked but just be black, with no  graphics  processes  running)
158       you  can  accomplish that by simply powering down the monitor remotely.
159       In a minute or so, xscreensaver will notice that the  monitor  is  off,
160       and will stop running screen hacks.  You can power off the monitor like
161       so:
162
163            xset dpms force off
164
165       See the xset(1) manual for more info.
166
167       You can also use xscreensaver-settings(1) to  make  the  monitor  power
168       down after a few hours, meaning that xscreensaver will run graphics un‐
169       til it has been idle for the length of time you  specified;  and  after
170       that, the monitor will power off, and screen hacks will stop being run.
171

DIAGNOSTICS

173       If an error occurs while communicating with the xscreensaver daemon, or
174       if the daemon reports an error, a diagnostic message will be printed to
175       stderr,  and  xscreensaver-command will exit with a non-zero value.  If
176       the command is accepted, an indication of this will be printed to  std‐
177       out, and the exit value will be zero.
178

ENVIRONMENT

180       DISPLAY to get the host and display number of the screen whose saver is
181               to be manipulated.
182
183       PATH    to find the executable to restart (for the --restart  command).
184               Note  that this variable is consulted in the environment of the
185               xscreensaver process, not the xscreensaver-command process.
186

UPGRADES

188       The latest version of xscreensaver(1) and related tools can  always  be
189       found at https://www.jwz.org/xscreensaver/
190

SEE ALSO

192       X(1), xscreensaver(1), xscreensaver-settings(1), xset(1)
193
195       Copyright © 1992-2021 by Jamie Zawinski.  Permission to use, copy, mod‐
196       ify, distribute, and sell this software and its documentation  for  any
197       purpose  is  hereby  granted without fee, provided that the above copy‐
198       right notice appear in all copies and that both that  copyright  notice
199       and this permission notice appear in supporting documentation.  No rep‐
200       resentations are made about the suitability of this  software  for  any
201       purpose.  It is provided "as is" without express or implied warranty.
202

AUTHOR

204       Jamie Zawinski <jwz@jwz.org>, 13-aug-1992.
205
206       Please let me know if you find any bugs or make any improvements.
207
208
209
210X Version 11               6.04-1.fc36 (06-Jun-2022)           XScreenSaver(1)
Impressum