From 615843d0b624aaab36c318a8daa2062e4e7f5a59 Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 30 Jun 2019 05:12:07 +0100 Subject: You're just nitpicking, hlint --- src/Xmobar/Plugins/Monitors/Batt.hs | 6 +++--- 1 file 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 -- cgit v1.2.3