]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
bin/battery.pl: Handle new keys ENERGY_NOW and ENERGY_FULL.
authorSimon Ruderich <simon@ruderich.org>
Thu, 24 Oct 2013 00:17:15 +0000 (02:17 +0200)
committerSimon Ruderich <simon@ruderich.org>
Thu, 24 Oct 2013 00:17:15 +0000 (02:17 +0200)
bin/battery.pl

index 9a6a9760b1705652953d0c40d454937538aefd62..0bdaae04c1d8829a33a0edaf2e8a4fb709ae5289 100755 (executable)
@@ -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.