From 3ddada25d66d3254376c3bb2cba33925221da788 Mon Sep 17 00:00:00 2001 From: RJ Regenold Date: Sat, 6 Apr 2013 09:49:49 -0500 Subject: caps battery percentage at 100%. --- src/Plugins/Monitors/Batt.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Plugins/Monitors/Batt.hs b/src/Plugins/Monitors/Batt.hs index 132b5a9..a593782 100644 --- a/src/Plugins/Monitors/Batt.hs +++ b/src/Plugins/Monitors/Batt.hs @@ -162,8 +162,9 @@ runBatt' bfs args = do NA -> return "N/A" where fmtPercent :: Float -> Monitor [String] fmtPercent x = do - p <- showPercentWithColors x - b <- showPercentBar (100 * x) x + let x' = minimum [1, x] + p <- showPercentWithColors x' + b <- showPercentBar (100 * x') x' return [b, p] fmtWatts x o s d = color x o $ showDigits d x ++ (if s then "W" else "") fmtTime :: Integer -> String -- cgit v1.2.3