From f69a7ec50716191a31b79be08998d9b2adf6c9fa Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 30 Jun 2019 01:13:57 +0100 Subject: hlinting --- src/Xmobar/Plugins/Monitors/Batt.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/Xmobar/Plugins/Monitors/Batt.hs') diff --git a/src/Xmobar/Plugins/Monitors/Batt.hs b/src/Xmobar/Plugins/Monitors/Batt.hs index bebbf1c..9ce0dca 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) +import Control.Monad (void, when) import Control.Exception (SomeException, handle) import Xmobar.Plugins.Monitors.Common import System.FilePath (()) @@ -184,10 +184,9 @@ mostCommonDef x xs = head $ last $ [x] : sortOn length (group xs) maybeAlert :: BattOpts -> Float -> IO () maybeAlert opts left = case onLowAction opts of - Nothing -> do return () - Just x -> if not (isNaN left) && actionThreshold opts >= (100 * left) - then void $ system x - else return () + Nothing -> return () + Just x -> when (not (isNaN left) && actionThreshold opts >= (100 * left)) + $ void $ system x readBatteries :: BattOpts -> [Files] -> IO Result readBatteries opts bfs = -- cgit v1.2.3