From 39820c0004230f4df7e256bc83ec1c9578f94a8d Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Sun, 8 Jul 2007 12:10:33 +0200 Subject: monitors are now run internally darcs-hash:20070708101033-d6583-495a895544a1fc84d4d69f52a7f26dd42b6c8af4.gz --- Monitors/Swap.hs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'Monitors/Swap.hs') diff --git a/Monitors/Swap.hs b/Monitors/Swap.hs index 96b32f1..7a69341 100644 --- a/Monitors/Swap.hs +++ b/Monitors/Swap.hs @@ -12,15 +12,15 @@ -- ----------------------------------------------------------------------------- -module Main where +module Monitors.Swap where import Monitors.Common import Data.IORef import qualified Data.ByteString.Lazy.Char8 as B -monitorConfig :: IO MConfig -monitorConfig = +swapConfig :: IO MConfig +swapConfig = do lc <- newIORef "#BFBFBF" l <- newIORef 30 nc <- newIORef "#00FF00" @@ -44,21 +44,23 @@ parseMEM = free = p (1,12) file return [tot, (tot - free), free, (tot - free) / tot * 100] -formatMem :: [Float] -> Monitor [String] -formatMem x = +formatSwap :: [Float] -> Monitor [String] +formatSwap x = do let f n = show (takeDigits 2 n) mapM (showWithColors f) x package :: String package = "xmb-swap" -runMem :: [String] -> Monitor String -runMem _ = +runSwap :: [String] -> Monitor String +runSwap _ = do m <- io $ parseMEM - l <- formatMem m + l <- formatSwap m parseTemplate l +{- main :: IO () main = - do let af = runMem [] - runMonitor monitorConfig af runMem + do let af = runSwap [] + runMonitor swapConfig af runSwap +-} \ No newline at end of file -- cgit v1.2.3