summaryrefslogtreecommitdiffhomepage
path: root/Monitors/Swap.hs
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@ing.unitn.it>2007-07-08 12:10:33 +0200
committerAndrea Rossato <andrea.rossato@ing.unitn.it>2007-07-08 12:10:33 +0200
commit39820c0004230f4df7e256bc83ec1c9578f94a8d (patch)
treede263f0d05be28e81d2acb90cfb7a6ab589f93b9 /Monitors/Swap.hs
parentc88df2b5d3cabc8e8171a422a48d0f811549f512 (diff)
downloadxmobar-39820c0004230f4df7e256bc83ec1c9578f94a8d.tar.gz
xmobar-39820c0004230f4df7e256bc83ec1c9578f94a8d.tar.bz2
monitors are now run internally
darcs-hash:20070708101033-d6583-495a895544a1fc84d4d69f52a7f26dd42b6c8af4.gz
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