All pastes #561566 Raw Edit

Someone

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

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