diff options
-rwxr-xr-x | battery | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; } |