diff options
author | Reto Hablützel <rethab@rethab.ch> | 2014-08-09 21:33:10 +0200 |
---|---|---|
committer | jao <jao@gnu.org> | 2014-08-09 23:18:46 +0200 |
commit | d9b24473ce65c6ce7f5bdea8c7d6eee07a62461e (patch) | |
tree | f748cd2c2f4df5753955a660044cf28a8737cb16 /src/Plugins/Monitors/Mem.hs | |
parent | 35054d018c79d4b4da2dd93830dc351d28635242 (diff) | |
download | xmobar-d9b24473ce65c6ce7f5bdea8c7d6eee07a62461e.tar.gz xmobar-d9b24473ce65c6ce7f5bdea8c7d6eee07a62461e.tar.bz2 |
hlint refactorings
Diffstat (limited to 'src/Plugins/Monitors/Mem.hs')
-rw-r--r-- | src/Plugins/Monitors/Mem.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Plugins/Monitors/Mem.hs b/src/Plugins/Monitors/Mem.hs index e409095..db2e5de 100644 --- a/src/Plugins/Monitors/Mem.hs +++ b/src/Plugins/Monitors/Mem.hs @@ -30,10 +30,10 @@ parseMEM :: IO [Float] parseMEM = do file <- fileMEM let content = map words $ take 8 $ lines file - info = M.fromList $ map (\line -> (line !! 0, (read $ line !! 1 :: Float) / 1024)) content + info = M.fromList $ map (\line -> (head line, (read $ line !! 1 :: Float) / 1024)) content [total, free, buffer, cache] = map (info M.!) ["MemTotal:", "MemFree:", "Buffers:", "Cached:"] rest = free + buffer + cache - used = total - (M.findWithDefault rest "MemAvailable:" info) + used = total - M.findWithDefault rest "MemAvailable:" info usedratio = used / total freeratio = free / total return [usedratio, freeratio, total, free, buffer, cache, rest, used, freeratio] |