From 1136c5da379db5034a4bf41236ad868d7fd479a4 Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 13 Aug 2022 17:39:37 +0100 Subject: fix: in -W0, char 0->[0,10], char 1->[10,20]... --- src/Xmobar/Plugins/Monitors/Common/Output.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Xmobar/Plugins/Monitors/Common/Output.hs b/src/Xmobar/Plugins/Monitors/Common/Output.hs index d87263f..bd60710 100644 --- a/src/Xmobar/Plugins/Monitors/Common/Output.hs +++ b/src/Xmobar/Plugins/Monitors/Common/Output.hs @@ -223,7 +223,7 @@ showPercentBar v x = do bw <- getConfigValue barWidth let c = bw < 1 w = if c then length bf else bw - len = min w $ round (fromIntegral w * x) + len = min w $ (if c then ceiling else round) (fromIntegral w * x) bfs = if c then [bf !! max 0 (len - 1)] else take len $ cycle bf s <- colorizeString v bfs return $ s ++ if c then "" else take (bw - len) (cycle bb) -- cgit v1.2.3