From 528dfc748ffbde6c83333daefd2b265dcd62f206 Mon Sep 17 00:00:00 2001 From: "Jose A. Ortega Ruiz" Date: Wed, 20 Jan 2010 22:56:08 +0100 Subject: New Monitor option to specify minimum percentage width Ignore-this: 5e0413c218f257c0db06f83665bd2e5 The new option, -p, is a number specifying how many characters the numerical part of percentages should take. Padding consists of whitespace. E.g. -p 3 makes '3%' appear as ' 3%'. The default value is 0, which means padding is disabled. darcs-hash:20100120215608-40885-2c2ac6718af740971dad491eea92947bae840163.gz --- Plugins/Monitors/Batt.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Plugins/Monitors/Batt.hs') diff --git a/Plugins/Monitors/Batt.hs b/Plugins/Monitors/Batt.hs index 03becaa..6ea62a9 100644 --- a/Plugins/Monitors/Batt.hs +++ b/Plugins/Monitors/Batt.hs @@ -61,10 +61,7 @@ parseBATT bfs = return $ if isNaN left then NA else Batt left c0 formatBatt :: Float -> Monitor [String] -formatBatt x = - do let f s = floatToPercent (s / 100) - l <- showWithColors f (x * 100) - return [l] +formatBatt x = showPercentsWithColors [x] runBatt :: [String] -> Monitor String runBatt = runBatt' ["BAT0","BAT1","BAT2"] -- cgit v1.2.3