Untitled
public text v1 · immutable#!/usr/bin/perl
my $i=0
my $blanked = 0;
open (IN, "xscreensaver-command -watch |");
while (<IN>) {
if (m/^(BLANK|LOCK)/) {
if (!$blanked) {
system "cpufreq-set -f 700MHz";
$blanked = 1;
}
} elsif (m/^UNBLANK/) {
system "cpufreq-set -f 2.80GHz";
$blanked = 0;
}
elsif (m/^RUN/) {
if $i>4
system "xfce4-session-logout";
$blanked = 0;
}
}
}