summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-03-19 21:00:47 -0400
committerJesse Luehrs <doy@tozt.net>2014-03-19 21:01:08 -0400
commitb6d293ea605190d5547965343bc50b15565c51f3 (patch)
tree896c2f249e251b029b6a7dde723875fde2854a4f /bin
parent3fd98c365894218b0fb48b494b1835d299e43edb (diff)
downloadconf-b6d293ea605190d5547965343bc50b15565c51f3.tar.gz
conf-b6d293ea605190d5547965343bc50b15565c51f3.zip
fix undef warning
Diffstat (limited to 'bin')
-rwxr-xr-xbin/status1
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/status b/bin/status
index 6c065f5..581657f 100755
--- a/bin/status
+++ b/bin/status
@@ -51,6 +51,7 @@ while (<$i3status>) {
my ($state, $val) = $item->{full_text} =~ /(\w+) (\d+(?:\.\d+))%/;
($discharge_rate{$item->{instance}}) = $item->{full_text} =~ /\(.* (.*)W\)/;
$discharge_rate{$item->{instance}} *= -1 if defined($discharge_rate{$item->{instance}}) && $state ne 'BAT';
+ $discharge_rate{$item->{instance}} //= 0;
$battery_index{$item->{instance}} = $index;
$item->{full_text} =~ s/\((.*) (.*)W\)/\($1\)/;
$item->{color} =