.
Two other building blocks seem to be
and the following perl program, which tracks the output of the -watch commandCode:xscreensaver-command -watch
and reacts accordingly:
I don't think perl should be necessary, and there is probably a simplerCode:#!/usr/bin/perl my $blanked = 0; open (IN, "xscreensaver-command -watch |"); while (<IN>) { if (m/^(BLANK|LOCK)/) { if (!$blanked) { # **** action to take when screensaver starts **** $blanked = 1; } } elsif (m/^UNBLANK/) { # **** action (if any) to take when screensaver is reset **** $blanked = 0; } }
bash equivalent that would suffice.


Reply With Quote










