summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/Plugins')
-rw-r--r--src/Plugins/Monitors/Batt.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Plugins/Monitors/Batt.hs b/src/Plugins/Monitors/Batt.hs
index 4c0232f..410aec6 100644
--- a/src/Plugins/Monitors/Batt.hs
+++ b/src/Plugins/Monitors/Batt.hs
@@ -163,8 +163,8 @@ runBatt' bfs args = do
case c of
Result x w t s ->
do l <- fmtPercent x
- let ts = [fmtTime $ floor t, fmtWatts w opts suffix d]
- parseTemplate (l ++ s:ts)
+ ws <- fmtWatts w opts suffix d
+ parseTemplate (l ++ [s, fmtTime $ floor t, ws])
NA -> return "N/A"
where fmtPercent :: Float -> Monitor [String]
fmtPercent x = do
@@ -172,7 +172,9 @@ runBatt' bfs args = do
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 "")
+ fmtWatts x o s d = do
+ ws <- showWithPadding $ showDigits d x ++ (if s then "W" else "")
+ return $ color x o ws
fmtTime :: Integer -> String
fmtTime x = hours ++ ":" ++ if length minutes == 2
then minutes else '0' : minutes