From b06e8cc8b451e4bd62af0901241a136abedc0c7e Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 12 Aug 2016 00:27:33 +0200 Subject: Battery monitor: yet another stab at #271 --- src/Plugins/Monitors/Batt.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Plugins/Monitors/Batt.hs b/src/Plugins/Monitors/Batt.hs index 5dc305f..0469ac2 100644 --- a/src/Plugins/Monitors/Batt.hs +++ b/src/Plugins/Monitors/Batt.hs @@ -188,9 +188,9 @@ readBatteries opts bfs = (sort (map status bats)) acst = mostCommonDef Unknown $ filter (Unknown/=) statuses racst | acst /= Unknown = acst - | not ac = Discharging - | left == 0 = Full - | otherwise = Charging + | time == 0 = Idle + | ac = Charging + | otherwise = Discharging return $ if isNaN left then NA else Result left watts time racst runBatt :: [String] -> Monitor String -- cgit v1.2.3