summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-24 00:31:06 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-24 00:31:27 -0400
commitbffc2a9c22603ce765b63c3840e77fbe219a4dfe (patch)
treeb22a1c4df1ed08838d2671f7701f900bceb93fe9
parentd05f4ea0d806d83e709c86f6aaeec38d299c3afb (diff)
downloadconf-bffc2a9c22603ce765b63c3840e77fbe219a4dfe.tar.gz
conf-bffc2a9c22603ce765b63c3840e77fbe219a4dfe.zip
make battery display look a bit nicer
-rwxr-xr-xbin/status2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/status b/bin/status
index 771838e..56298e5 100755
--- a/bin/status
+++ b/bin/status
@@ -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}),