Code Sample |
. . } else { print ":00"; } print " remains\n"; if ($state eq "discharging" and $prate == 0) { $printstate = "AC on-line"; } elsif ($state eq "charging") { $printstate = "AC on-line and charging"; } elsif ($state eq "discharging") { $printstate = "AC unplugged"; } print " $remain%, $printstate"; |
Code Sample |
cat /proc/acpi/battery/BAT0/state |