diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-04-24 00:31:06 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-04-24 00:31:27 -0400 |
commit | bffc2a9c22603ce765b63c3840e77fbe219a4dfe (patch) | |
tree | b22a1c4df1ed08838d2671f7701f900bceb93fe9 | |
parent | d05f4ea0d806d83e709c86f6aaeec38d299c3afb (diff) | |
download | conf-bffc2a9c22603ce765b63c3840e77fbe219a4dfe.tar.gz conf-bffc2a9c22603ce765b63c3840e77fbe219a4dfe.zip |
make battery display look a bit nicer
-rwxr-xr-x | bin/status | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -57,6 +57,7 @@ while (<$i3status>) { $battery_index{$item->{instance}} = $index; $item->{full_text} =~ s/\((.*) (.*)W\)/\($1\)/; + $item->{full_text} =~ s/ \(\)//; $item->{color} = $val >= 80 ? '#00FF00' : $state ne 'BAT' ? '#FFFFFF' @@ -71,6 +72,7 @@ while (<$i3status>) { my @batteries = sort { $battery_index{$b} <=> $battery_index{$a} } keys %battery_index; for my $battery (@batteries) { + next unless $discharge_rate{$battery}; splice @$line, $battery_index{$battery} + 1, 0, { name => 'battery_discharge', full_text => sprintf("%0.2fW", $discharge_rate{$battery}), |