From 57b8cee954996394d0ba7212819ffe592d2148b4 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosciuszkiewicz Date: Thu, 12 Jul 2007 03:09:11 +0200 Subject: Allow reverse "high" and "low" thresholds darcs-hash:20070712010911-ba08c-adf596c43d2f8ad049449dfef96d7e00758baae8.gz --- Plugins/Monitors/Common.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Plugins') diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs index 26b6289..8e2703f 100644 --- a/Plugins/Monitors/Common.hs +++ b/Plugins/Monitors/Common.hs @@ -51,6 +51,7 @@ import Control.Monad.Reader import qualified Data.ByteString.Lazy.Char8 as B import Data.IORef import qualified Data.Map as Map +import Data.List import Numeric @@ -262,9 +263,10 @@ showWithColors f x = do h <- getConfigValue high l <- getConfigValue low let col = setColor $ f x - head $ [col highColor | x > fromIntegral h ] ++ - [col normalColor | x > fromIntegral l ] ++ - [col lowColor | True] + [ll,hh] = map fromIntegral $ sort [l, h] -- consider high < low + head $ [col highColor | x > hh ] ++ + [col normalColor | x < ll ] ++ + [col lowColor | True] -- $threads -- cgit v1.2.3