diff options
author | dakkar <dakkar@thenautilus.net> | 2024-10-08 21:06:10 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2024-10-08 21:06:10 +0100 |
commit | 02eaed4355f309041368963a892ba7552bd7b1d1 (patch) | |
tree | 9453c169634c8e481cded34db6e29d58361a2361 | |
parent | empty battery, but later (diff) | |
download | battery-02eaed4355f309041368963a892ba7552bd7b1d1.tar.gz battery-02eaed4355f309041368963a892ba7552bd7b1d1.tar.bz2 battery-02eaed4355f309041368963a892ba7552bd7b1d1.zip |
no time estimate while charging
the current we get is what we're using, not what we're charging with
-rwxr-xr-x | battery | 19 |
1 files changed, 7 insertions, 12 deletions
@@ -63,18 +63,13 @@ sub update { my $time_estimate=''; my $percentage=sprintf '%.0f%%', 100*$fraction; - if ($deriv) { - if ($charging) { - $time_estimate = _format_time(($full-$now)/$deriv); - } - else { - my $t=$now/$deriv; - my $tot=$full/$deriv; - - $time_estimate = sprintf "%s/%s", - _format_time($t), - _format_time($tot); - } + if ($deriv && !$charging) { + my $t=$now/$deriv; + my $tot=$full/$deriv; + + $time_estimate = sprintf "%s/%s", + _format_time($t), + _format_time($tot); } if ($charging) { |