summaryrefslogtreecommitdiffhomepage
path: root/Plugins/Monitors/Batt.hs
diff options
context:
space:
mode:
authorJose A. Ortega Ruiz <jao@gnu.org>2010-01-20 22:56:08 +0100
committerJose A. Ortega Ruiz <jao@gnu.org>2010-01-20 22:56:08 +0100
commit528dfc748ffbde6c83333daefd2b265dcd62f206 (patch)
treebd5623ec54ee5d67bb699cb20240c2581a5868df /Plugins/Monitors/Batt.hs
parent2d6911f940ec82c2054cf96b151ac9ff61372865 (diff)
downloadxmobar-528dfc748ffbde6c83333daefd2b265dcd62f206.tar.gz
xmobar-528dfc748ffbde6c83333daefd2b265dcd62f206.tar.bz2
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
Diffstat (limited to 'Plugins/Monitors/Batt.hs')
-rw-r--r--Plugins/Monitors/Batt.hs5
1 files changed, 1 insertions, 4 deletions
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"]