From 4768d84d13a015c76200010e32ae1515264fd1bb Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Tue, 7 Dec 2010 16:26:09 +0100 Subject: Fix for swap used ratio (issue 24) Thanks to Dan Brown for pointing this out. I've applied a modified version of his patch (inclusion of % will be treated separately). --- Plugins/Monitors/Common.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Plugins/Monitors/Common.hs') diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs index 9362fd8..c90c616 100644 --- a/Plugins/Monitors/Common.hs +++ b/Plugins/Monitors/Common.hs @@ -39,6 +39,7 @@ module Plugins.Monitors.Common ( , showWithPadding , showWithColors , showWithColors' + , showPercentWithColors , showPercentsWithColors , showPercentBar , showLogBar @@ -386,6 +387,9 @@ showPercentsWithColors fs = do fstrs <- mapM floatToPercent fs zipWithM (showWithColors . const) fstrs (map (*100) fs) +showPercentWithColors :: Float -> Monitor String +showPercentWithColors f = liftM head $ showPercentsWithColors [f] + showPercentBar :: Float -> Float -> Monitor String showPercentBar v x = do bb <- getConfigValue barBack -- cgit v1.2.3