summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2019-06-30 01:13:57 +0100
committerjao <jao@gnu.org>2019-06-30 01:13:57 +0100
commitf69a7ec50716191a31b79be08998d9b2adf6c9fa (patch)
treebd6896c9f442b93ab31a7b232283ca26042854df /src
parent365d0a7c97f3905c16caf70c0bb7ef6054b232f2 (diff)
downloadxmobar-f69a7ec50716191a31b79be08998d9b2adf6c9fa.tar.gz
xmobar-f69a7ec50716191a31b79be08998d9b2adf6c9fa.tar.bz2
hlinting
Diffstat (limited to 'src')
-rw-r--r--src/Xmobar/Plugins/Monitors/Batt.hs9
-rw-r--r--src/Xmobar/Plugins/Monitors/Mpris.hs2
2 files changed, 5 insertions, 6 deletions
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 =
diff --git a/src/Xmobar/Plugins/Monitors/Mpris.hs b/src/Xmobar/Plugins/Monitors/Mpris.hs
index 3556649..480698c 100644
--- a/src/Xmobar/Plugins/Monitors/Mpris.hs
+++ b/src/Xmobar/Plugins/Monitors/Mpris.hs
@@ -85,7 +85,7 @@ dbusClient = unsafePerformIO DC.connectSession
runMPRIS :: (MprisVersion a) => a -> String -> [String] -> Monitor String
runMPRIS version playerName _ = do
metadata <- io $ getMetadata version dbusClient playerName
- if [] == metadata then
+ if null metadata then
getConfigValue naString
else mapM showWithPadding (makeList version metadata) >>= parseTemplate