From 02eaed4355f309041368963a892ba7552bd7b1d1 Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 8 Oct 2024 21:06:10 +0100 Subject: no time estimate while charging the current we get is what we're using, not what we're charging with --- battery | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/battery b/battery index d59a221..efce846 100755 --- a/battery +++ b/battery @@ -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) { -- cgit v1.2.3