diff options
Diffstat (limited to 'src/Xmobar/Plugins/Monitors')
-rw-r--r-- | src/Xmobar/Plugins/Monitors/Load/Linux.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Load/Linux.hs b/src/Xmobar/Plugins/Monitors/Load/Linux.hs index 9ba5a5c..19174c7 100644 --- a/src/Xmobar/Plugins/Monitors/Load/Linux.hs +++ b/src/Xmobar/Plugins/Monitors/Load/Linux.hs @@ -22,9 +22,9 @@ import System.Posix.Files (fileExist) -- | Parses the contents of a loadavg proc file, returning -- the list of load averages -parseLoadAvgs :: B.ByteString -> [Float] +parseLoadAvgs :: B.ByteString -> Result parseLoadAvgs = - map (read . B.unpack) . take 3 . B.words . head . B.lines + Result . map (read . B.unpack) . take 3 . B.words . head . B.lines fetchLoads :: IO Result fetchLoads = do @@ -32,7 +32,6 @@ fetchLoads = do exists <- fileExist file if exists then - (do contents <- B.readFile file - return $ Result (parseLoadAvgs contents)) + parseLoadAvgs <$> B.readFile file else - return NA + return NA |