summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors/Swap.hs
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2011-12-18 03:17:38 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2011-12-18 03:17:38 +0100
commitfa5443124c7aded9698e7683eca1e5c31a550ed4 (patch)
tree006fdebe6e83a1b4619cb8c0f9060274f41a357d /src/Plugins/Monitors/Swap.hs
parent1e43372a6112a8f07ab47be470ba68633f96741b (diff)
downloadxmobar-fa5443124c7aded9698e7683eca1e5c31a550ed4.tar.gz
xmobar-fa5443124c7aded9698e7683eca1e5c31a550ed4.tar.bz2
New -d (decimal digits) monitor option (issue #58)
Diffstat (limited to 'src/Plugins/Monitors/Swap.hs')
-rw-r--r--src/Plugins/Monitors/Swap.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Plugins/Monitors/Swap.hs b/src/Plugins/Monitors/Swap.hs
index e466dbb..107eb1e 100644
--- a/src/Plugins/Monitors/Swap.hs
+++ b/src/Plugins/Monitors/Swap.hs
@@ -42,10 +42,11 @@ parseMEM =
return [(tot - free) / tot, tot, tot - free, free]
formatSwap :: [Float] -> Monitor [String]
-formatSwap (r:xs) =
- do other <- mapM (showWithColors (showDigits 2)) xs
- ratio <- showPercentWithColors r
- return $ ratio:other
+formatSwap (r:xs) = do
+ d <- getConfigValue decDigits
+ other <- mapM (showWithColors (showDigits d)) xs
+ ratio <- showPercentWithColors r
+ return $ ratio:other
formatSwap _ = return $ replicate 4 "N/A"
runSwap :: [String] -> Monitor String