From 65f67cc86d3929802f227133c1003dc4174ee85d Mon Sep 17 00:00:00 2001 From: Pavel Kalugin Date: Mon, 31 Jan 2022 21:48:15 +0300 Subject: Text output: support choosing between Pango and ANSI markup Signed-off-by: Pavel Kalugin --- src/Xmobar/Config/Parse.hs | 7 ++++--- src/Xmobar/Config/Types.hs | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/Xmobar/Config') diff --git a/src/Xmobar/Config/Parse.hs b/src/Xmobar/Config/Parse.hs index 4c43e4d..fa99c59 100644 --- a/src/Xmobar/Config/Parse.hs +++ b/src/Xmobar/Config/Parse.hs @@ -62,7 +62,7 @@ parseConfig defaultConfig = perms = permute $ Config <$?> pFont <|?> pFontList <|?> pWmClass <|?> pWmName <|?> pBgColor <|?> pFgColor <|?> pPosition - <|?> pTextOutput <|?> pAnsiColors + <|?> pTextOutput <|?> pTextOutputColors <|?> pTextOffset <|?> pTextOffsets <|?> pIconOffset <|?> pBorder <|?> pBdColor <|?> pBdWidth <|?> pAlpha <|?> pHideOnStart @@ -71,17 +71,18 @@ parseConfig defaultConfig = <|?> pCommands <|?> pSepChar <|?> pAlignSep <|?> pTemplate <|?> pVerbose <|?> pSignal - fields = [ "font", "additionalFonts","bgColor", "fgColor" + fields = [ "font", "additionalFonts", "bgColor", "fgColor" , "wmClass", "wmName", "sepChar" , "alignSep" , "border", "borderColor" ,"template" , "position" , "textOffset", "textOffsets", "iconOffset" , "allDesktops", "overrideRedirect", "pickBroadest" , "hideOnStart", "lowerOnStart", "persistent", "iconRoot" , "alpha", "commands", "verbose", "signal", "textOutput" + , "textOutputColors" ] pTextOutput = readField textOutput "textOutput" - pAnsiColors = readField textOutput "textAnsiColors" + pTextOutputColors = readField textOutputColors "textOutputColors" pFont = strField font "font" pFontList = strListField additionalFonts "additionalFonts" pWmClass = strField wmClass "wmClass" diff --git a/src/Xmobar/Config/Types.hs b/src/Xmobar/Config/Types.hs index 6ea012f..5f19528 100644 --- a/src/Xmobar/Config/Types.hs +++ b/src/Xmobar/Config/Types.hs @@ -16,7 +16,7 @@ module Xmobar.Config.Types ( -- * Configuration -- $config Config (..) - , XPosition (..), Align (..), Border(..) + , XPosition (..), Align (..), Border (..), TextColorFormat (..) , SignalChan (..) ) where @@ -37,7 +37,7 @@ data Config = , fgColor :: String -- ^ Default font color , position :: XPosition -- ^ Top Bottom or Static , textOutput :: Bool -- ^ Write data to stdout instead of X - , ansiColors :: Bool -- ^ Use ANSI color escapes for stdout + , textOutputColors :: TextColorFormat -- ^ Which color format to use for stdout: Ansi or Pango , textOffset :: Int -- ^ Offset from top of window for text , textOffsets :: [Int] -- ^ List of offsets for additionalFonts , iconOffset :: Int -- ^ Offset from top of window for icons @@ -98,6 +98,8 @@ data Border = NoBorder | FullBM Int deriving ( Read, Show, Eq ) +data TextColorFormat = NoColors | Ansi | Pango deriving ( Read, Show, Eq ) + newtype SignalChan = SignalChan { unSignalChan :: Maybe (STM.TMVar SignalType) } instance Read SignalChan where -- cgit v1.2.3