From dc262d1628aa3e1bfe17ce99bfe89782b6185cc5 Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 3 Feb 2022 05:14:45 +0000 Subject: TextOutputColor -> TextOutputFormat Thinking of eventually adding a Sway JSON output, or simply add fonts to Pango specification, so it's more than colors. Also, NoColors -> Plain. --- src/Xmobar/App/TextEventLoop.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Xmobar/App/TextEventLoop.hs') diff --git a/src/Xmobar/App/TextEventLoop.hs b/src/Xmobar/App/TextEventLoop.hs index 3b754ac..e516298 100644 --- a/src/Xmobar/App/TextEventLoop.hs +++ b/src/Xmobar/App/TextEventLoop.hs @@ -27,7 +27,7 @@ import Control.Concurrent.Async (Async) import Control.Concurrent.STM import Xmobar.System.Signal -import Xmobar.Config.Types (Config(textOutputColors), TextColorFormat(..)) +import Xmobar.Config.Types (Config(textOutputFormat), TextOutputFormat(..)) import Xmobar.X11.Parsers (Segment, Widget(..), parseString, tColorsString, colorComponents) import Xmobar.App.CommandThreads (initLoop, loop) @@ -100,16 +100,16 @@ withPangoColor (fg, bg) s = printf fmt (xmlEscape fg) (xmlEscape bg) (xmlEscape s) where fmt = "%s" -withColor :: TextColorFormat -> (String, String) -> String -> String +withColor :: TextOutputFormat -> (String, String) -> String -> String withColor format color = case format of - NoColors -> id + Plain -> id Ansi -> withAnsiColor color Pango -> withPangoColor color - + asText :: Config -> Segment -> String asText conf (Text s, info, _, _) = - withColor (textOutputColors conf) components s + withColor (textOutputFormat conf) components s where components = colorComponents conf color color = tColorsString info asText colors (Hspace n, i, x, y) = -- cgit v1.2.3