diff options
author | jao <jao@gnu.org> | 2016-08-12 00:27:33 +0200 |
---|---|---|
committer | jao <jao@gnu.org> | 2016-08-12 00:27:33 +0200 |
commit | b06e8cc8b451e4bd62af0901241a136abedc0c7e (patch) | |
tree | d71af6efbc0dd4d41e0a26a8d7d3a95b8056da27 /src/Plugins | |
parent | 90cc2c33676efa0fb0936ec63868cf6168889f3e (diff) | |
download | xmobar-b06e8cc8b451e4bd62af0901241a136abedc0c7e.tar.gz xmobar-b06e8cc8b451e4bd62af0901241a136abedc0c7e.tar.bz2 |
Battery monitor: yet another stab at #271
Diffstat (limited to 'src/Plugins')
-rw-r--r-- | src/Plugins/Monitors/Batt.hs | 6 |
1 files 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 |