diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-02-06 11:36:08 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-02-06 11:43:14 -0500 |
commit | 33c898b0ce910796d3f5255fe7bbc3e8a4101cbd (patch) | |
tree | cb8c10fb39197332017135f7b5b4cc37d22bc7e4 /bin | |
parent | 1581692d39b10eca543c74f53083fa3ec2ae4f31 (diff) | |
download | conf-33c898b0ce910796d3f5255fe7bbc3e8a4101cbd.tar.gz conf-33c898b0ce910796d3f5255fe7bbc3e8a4101cbd.zip |
avoid an undef warning
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/status | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -49,7 +49,7 @@ while (<$i3status>) { if ($item->{name} eq 'battery') { my ($state, $val) = $item->{full_text} =~ /(\w+) (\d+(?:\.\d+))%/; ($discharge_rate) = $item->{full_text} =~ /\(.* (.*)W\)/; - $discharge_rate *= -1 if $state ne 'BAT'; + $discharge_rate *= -1 if defined($discharge_rate) && $state ne 'BAT'; $item->{full_text} =~ s/\((.*) (.*)W\)/\($1\)/; $item->{color} = $val >= 80 ? '#00FF00' |