well I can use xscreensaver-command-watch which: (from
http://www.jwz.org/xscreensaver/man3.html )
Prints a line each time the screensaver changes state: when the screen blanks, locks, unblanks, or when the running hack is changed. This option never returns; it is intended for use by shell scripts that want to react to the screensaver in some way. An example of its output would be:
BLANK Fri Nov 5 01:57:22 1999
RUN 34
RUN 79
RUN 16
LOCK Fri Nov 5 01:57:22 1999
RUN 76
RUN 12
UNBLANK Fri Nov 5 02:05:59 1999
The above shows the screensaver activating, running three different hacks, then locking (perhaps because the lock-timeout went off) then unblanking (because the user became active, and typed the correct password.) The hack numbers are their index in the `programs' list (starting with 1, not 0, as for the -select command.)
For example, suppose you want to run a program that turns down the volume on your machine when the screen blanks, and turns it back up when the screen un-blanks. You could do that by running a Perl program like the following in the background. The following program tracks the output of the -watch command and reacts accordingly:
#!/usr/bin/perl
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;
}
}
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.
What I dont understand is what should be in the script in order to ssh to the windows box and run the script located there to put the windows box into standby?