summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xmobar')
-rw-r--r--src/Xmobar/Plugins/Monitors/Batt.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Batt.hs b/src/Xmobar/Plugins/Monitors/Batt.hs
index 292054e..e29870a 100644
--- a/src/Xmobar/Plugins/Monitors/Batt.hs
+++ b/src/Xmobar/Plugins/Monitors/Batt.hs
@@ -16,7 +16,7 @@
module Xmobar.Plugins.Monitors.Batt ( battConfig, runBatt, runBatt' ) where
import System.Process (system)
-import Control.Monad (void, when)
+import Control.Monad (void, unless)
import Control.Exception (SomeException, handle)
import Xmobar.Plugins.Monitors.Common
import System.FilePath ((</>))
@@ -185,7 +185,7 @@ maybeAlert :: BattOpts -> Float -> IO ()
maybeAlert opts left =
case onLowAction opts of
Nothing -> return ()
- Just x -> when (not (isNaN left) && actionThreshold opts >= (100 * left))
+ Just x -> unless (isNaN left || actionThreshold opts < 100 * left)
$ void $ system x
readBatteries :: BattOpts -> [Files] -> IO Result
@@ -208,7 +208,7 @@ readBatteries opts bfs =
| time == 0 = Idle
| ac = Charging
| otherwise = Discharging
- when (not ac) (maybeAlert opts left)
+ unless ac (maybeAlert opts left)
return $ if isNaN left then NA else Result left watts time racst
runBatt :: [String] -> Monitor String