Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'another way' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
another way
Authored by: SOX on Dec 16, '09 09:59:50AM
better script.

$s =0;
while (1) {
$r=`pmset -g batt`;
if ( $r =~ m/AC/) {
   $s = 1;}
else {
	if ($s) {
    system ("say", "AC shutdown!");
    $s =0;
   }}
 sleep 240;

}


[ Reply to This | # ]