summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors/Batt.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Plugins/Monitors/Batt.hs')
-rw-r--r--src/Plugins/Monitors/Batt.hs8
1 files 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