diff options
Diffstat (limited to 'battery')
-rwxr-xr-x | battery | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -53,11 +53,17 @@ sub update { my $e=$bs->{energy_now}/$bs->{energy_full}; my $txt=''; my $charging = lc($bs->{status}) eq 'charging'; - if ($bs->{power_now}) { + if ($charging) { + $txt = "\x{1f50c} "; + } + else { + $txt = "\x{1f50b} "; + } + if ($bs->{power_now} && !$charging) { my $t=$bs->{energy_now}/$bs->{power_now}; my $tot=$bs->{energy_full}/$bs->{power_now}; - $txt = sprintf '%s/%s ', + $txt .= sprintf '%s/%s ', _format_time($charging ? $tot-$t : $t), _format_time($tot); $bar->set_fraction($t/$tot); |