summaryrefslogtreecommitdiffhomepage
path: root/Plugins/Monitors/Cpu.hs
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-12-08 01:38:14 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-12-08 01:38:14 +0100
commita615474dc2daa250602262d59bd3daa7d603cc12 (patch)
tree5815a4b4fba629cfea760afdafd20601ce01b341 /Plugins/Monitors/Cpu.hs
parent180fab582197384f7018543c106e1b641a0700e0 (diff)
downloadxmobar-a615474dc2daa250602262d59bd3daa7d603cc12.tar.gz
xmobar-a615474dc2daa250602262d59bd3daa7d603cc12.tar.bz2
Default to False for the -P option and leave the % to the templates
Diffstat (limited to 'Plugins/Monitors/Cpu.hs')
-rw-r--r--Plugins/Monitors/Cpu.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Plugins/Monitors/Cpu.hs b/Plugins/Monitors/Cpu.hs
index d94bd0f..78e3ec7 100644
--- a/Plugins/Monitors/Cpu.hs
+++ b/Plugins/Monitors/Cpu.hs
@@ -19,8 +19,8 @@ import qualified Data.ByteString.Lazy.Char8 as B
cpuConfig :: IO MConfig
cpuConfig = mkMConfig
- "Cpu: <total>" -- template
- ["bar","total","user","nice","system","idle"] -- available replacements
+ "Cpu: <total>%"
+ ["bar","total","user","nice","system","idle"]
cpuData :: IO [Float]
cpuData = do s <- B.readFile "/proc/stat"
@@ -28,7 +28,7 @@ cpuData = do s <- B.readFile "/proc/stat"
cpuParser :: B.ByteString -> [Float]
cpuParser =
- map read . map B.unpack . tail . B.words . flip (!!) 0 . B.lines
+ map (read . B.unpack) . tail . B.words . flip (!!) 0 . B.lines
parseCPU :: IO [Float]
parseCPU =
@@ -48,6 +48,6 @@ formatCpu xs = do
runCpu :: [String] -> Monitor String
runCpu _ =
- do c <- io $ parseCPU
+ do c <- io parseCPU
l <- formatCpu c
parseTemplate l