All pastes #561448 Raw Edit

Someone

public text v1 · immutable
·published 2007-06-12 13:43 UTC
rendered paste body
#!/usr/bin/perl

my $blanked = 0;
open (IN, "xscreensaver-command -watch |");
while (<IN>) {
    if (m/^(BLANK|LOCK)/) {
        if (!$blanked) {
         system "command1";
         $blanked = 1;
        }
    } elsif (m/^UNBLANK/) {
        system "command2";
        $blanked = 0;
    }
}