From 60b106ac0db19800667ee54b0d390d80e0873b52 Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 30 Mar 2022 06:17:42 +0100 Subject: Load monitor: correctly colorize according to -L/-H --- src/Xmobar/Plugins/Monitors/Load.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Xmobar/Plugins') diff --git a/src/Xmobar/Plugins/Monitors/Load.hs b/src/Xmobar/Plugins/Monitors/Load.hs index 238d374..e41e897 100644 --- a/src/Xmobar/Plugins/Monitors/Load.hs +++ b/src/Xmobar/Plugins/Monitors/Load.hs @@ -19,6 +19,7 @@ module Xmobar.Plugins.Monitors.Load (loadConfig, runLoad) where import Xmobar.Plugins.Monitors.Common import qualified Data.ByteString.Lazy.Char8 as B import System.Posix.Files (fileExist) +import Control.Monad (zipWithM) -- | Default configuration. loadConfig :: IO MConfig @@ -40,6 +41,7 @@ runLoad _ = do exists <- io $ fileExist file if exists then (do l <- io $ B.readFile file >>= return . parseLoadAvgs - parseTemplate =<< mapM (showWithColors $ showDigits 2) l) + let s = showWithColors . const . showDigits 2 + parseTemplate =<< zipWithM s l l) else return "Load: N/A" -- cgit v1.2.3