summaryrefslogtreecommitdiffhomepage
path: root/Monitors/Swap.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Monitors/Swap.hs')
-rw-r--r--Monitors/Swap.hs22
1 files changed, 12 insertions, 10 deletions
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