From e8f9e881d37536954f24d73b29cbccf86341c3d3 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 30 Dec 2013 17:34:49 +0100 Subject: Fix for time estimation when using the previous workaround --- src/Plugins/Monitors/Batt.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Plugins/Monitors/Batt.hs b/src/Plugins/Monitors/Batt.hs index 1d168af..c6e140e 100644 --- a/src/Plugins/Monitors/Batt.hs +++ b/src/Plugins/Monitors/Batt.hs @@ -131,10 +131,10 @@ readBattery sc files = do a <- grab $ fFull files b <- grab $ fNow files d <- grab $ fCurrent files - let d' = if isCurrent files then d * 10 else d - return $ Battery (3600 * a / sc) -- wattseconds - (3600 * b / sc) -- wattseconds - (d' / sc) -- watts + let sc' = if isCurrent files then sc / 10 else sc + return $ Battery (3600 * a / sc') -- wattseconds + (3600 * b / sc') -- wattseconds + (d / sc') -- watts where grab f = handle onError $ withFile f ReadMode (fmap read . hGetLine) onError = const (return (-1)) :: SomeException -> IO Float -- cgit v1.2.3