-If the screensaver is run from \fIxdm(1)\fP (that is, it is already running
-before you log in) then you may want to issue the ``restart'' command from
-one of your startup scripts, so that the screensaver gets your resource
-settings instead of the default ones.
+my $blanked = 0;
+open (IN, "xscreensaver-command -watch |");
+while (<IN>) {
+ if (m/^(BLANK|LOCK)/) {
+ if (!$blanked) {
+ system "sound-off";
+ $blanked = 1;
+ }
+ } elsif (m/^UNBLANK/) {
+ system "sound-on";
+ $blanked = 0;
+ }
+}
+.EE
+Note that LOCK might come either with or without a preceding BLANK
+(depending on whether the lock-timeout is non-zero), so the above program
+keeps track of both of them.
+.SH STOPPING GRAPHICS
+If xscreensaver is running, but you want it to stop running screen hacks
+(e.g., if you are logged in remotely, and you want the console to remain
+locked but just be black, with no graphics processes running) you can
+accomplish that by simply powering down the monitor remotely. In a
+minute or so, xscreensaver will notice that the monitor is off, and
+will stop running screen hacks. You can power off the monitor like so:
+.EX
+xset dpms force off
+.EE
+See the
+.BR xset (1)
+manual for more info.
+
+You can also use
+.BR xscreensaver-demo (1)
+to make the monitor power down after a few hours, meaning that xscreensaver
+will run graphics until it has been idle for the length of time you
+specified; and after that, the monitor will power off, and screen hacks
+will stop being run.
+.SH DIAGNOSTICS
+If an error occurs while communicating with the \fIxscreensaver\fP daemon, or
+if the daemon reports an error, a diagnostic message will be printed to
+stderr, and \fIxscreensaver-command\fP will exit with a non-zero value. If
+the command is accepted, an indication of this will be printed to stdout, and
+the exit value will be zero.