From: Simon Ruderich Date: Thu, 24 Oct 2013 00:17:15 +0000 (+0200) Subject: bin/battery.pl: Handle new keys ENERGY_NOW and ENERGY_FULL. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=77e20192f619f168bd22c09757dc09580e533cea;p=config%2Fdotfiles.git bin/battery.pl: Handle new keys ENERGY_NOW and ENERGY_FULL. --- diff --git a/bin/battery.pl b/bin/battery.pl index 9a6a976..0bdaae0 100755 --- a/bin/battery.pl +++ b/bin/battery.pl @@ -39,6 +39,12 @@ while (<$file>) { } close $file or die $!; +# New names ... +if (defined $battery{ENERGY_NOW}) { + $battery{CHARGE_NOW} = $battery{ENERGY_NOW}; + $battery{CHARGE_FULL} = $battery{ENERGY_FULL}; +} + my $charge = int($battery{CHARGE_NOW} / $battery{CHARGE_FULL} * 100); # GNU screen mode with colors: 0-20 red, 20-40 yellow, 40-100 green.