summaryrefslogtreecommitdiffhomepage
path: root/Plugins/Monitors/Cpu.hs
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2010-12-11 14:18:49 -0500
committerBen Boeckel <MathStuf@gmail.com>2010-12-11 14:18:49 -0500
commit6ac13d70d701bc6f0e8a24ef4fa67e501403fe81 (patch)
tree9e2a39720a849ef9b049ac330332765dba4deff1 /Plugins/Monitors/Cpu.hs
parent533d459b70774b3bbdab5dde1fcb442a579b36cc (diff)
downloadxmobar-6ac13d70d701bc6f0e8a24ef4fa67e501403fe81.tar.gz
xmobar-6ac13d70d701bc6f0e8a24ef4fa67e501403fe81.tar.bz2
Don't hard code the number of values
Make an infinite list of empty strings so that if something is asked for and cannot be provided, index errors don't occur.
Diffstat (limited to 'Plugins/Monitors/Cpu.hs')
-rw-r--r--Plugins/Monitors/Cpu.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Plugins/Monitors/Cpu.hs b/Plugins/Monitors/Cpu.hs
index 71e8ac3..fb5e9e2 100644
--- a/Plugins/Monitors/Cpu.hs
+++ b/Plugins/Monitors/Cpu.hs
@@ -39,7 +39,7 @@ parseCPU =
return percent
formatCpu :: [Float] -> Monitor [String]
-formatCpu [] = return [""]
+formatCpu [] = return $ repeat ""
formatCpu xs = do
let t = foldr (+) 0 $ take 3 xs
b <- showPercentBar (100 * t) t