summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2019-06-30 05:12:07 +0100
committerjao <jao@gnu.org>2019-06-30 05:12:07 +0100
commit615843d0b624aaab36c318a8daa2062e4e7f5a59 (patch)
treef991a062a4a8056750b8e6fb66fcdb9707a84044 /src/Xmobar/Plugins
parent2dd31f747895e19398ca292c0063f5ff46285a19 (diff)
downloadxmobar-615843d0b624aaab36c318a8daa2062e4e7f5a59.tar.gz
xmobar-615843d0b624aaab36c318a8daa2062e4e7f5a59.tar.bz2
You're just nitpicking, hlint
Diffstat (limited to 'src/Xmobar/Plugins')
-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