summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbattery3
1 files changed, 2 insertions, 1 deletions
diff --git a/battery b/battery
index a6de32b..7b64c02 100755
--- a/battery
+++ b/battery
@@ -37,7 +37,8 @@ sub get_battery_stats {
while (my $line=<$fh>) {
chomp $line;
my ($name,$value) = $line =~ m{\A POWER_SUPPLY_(.*?) = (.*) \z}x;
- $ret{lc($name)}=$value;
+ next unless $name;
+ $ret{lc($name)}= $ENV{"POWER_SUPPLY_$name"} || $value;
}
return \%ret;
}