summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Plugins/Monitors/Batt.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Plugins/Monitors/Batt.hs b/src/Plugins/Monitors/Batt.hs
index cc16ec8..38c325f 100644
--- a/src/Plugins/Monitors/Batt.hs
+++ b/src/Plugins/Monitors/Batt.hs
@@ -187,7 +187,11 @@ readBatteries opts bfs =
statuses = map (fromMaybe Unknown . readMaybe)
(sort (map status bats))
acst = mostCommonDef Unknown $ filter (Unknown/=) statuses
- return $ if isNaN left then NA else Result left watts time acst
+ racst | acst /= Unknown = acst
+ | not ac = Discharging
+ | left == 0 = Idle
+ | otherwise = Charging
+ return $ if isNaN left then NA else Result left watts time racst
runBatt :: [String] -> Monitor String
runBatt = runBatt' ["BAT0","BAT1","BAT2"]