From 48dc39edaca5ff4e011ea9475fe8b75d24b5e4c4 Mon Sep 17 00:00:00 2001 From: jao Date: Tue, 8 Feb 2022 00:21:31 +0000 Subject: pango output: fonts --- src/Xmobar/Text/Pango.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Xmobar/Text/Pango.hs') diff --git a/src/Xmobar/Text/Pango.hs b/src/Xmobar/Text/Pango.hs index 38d1b5b..30ec76f 100644 --- a/src/Xmobar/Text/Pango.hs +++ b/src/Xmobar/Text/Pango.hs @@ -15,7 +15,7 @@ -- ------------------------------------------------------------------------------ -module Xmobar.Text.Pango (withPangoColor, withPangoFont) where +module Xmobar.Text.Pango (withPangoColor, withPangoFont, withPangoMarkup) where import Text.Printf (printf) import Data.List (isPrefixOf) @@ -39,3 +39,9 @@ withPangoFont :: String -> String -> String withPangoFont font txt = printf fmt pfn (xmlEscape txt) where fmt = "%s" pfn = if "xft:" `isPrefixOf` font then drop 4 font else font + +withPangoMarkup :: String -> String -> String -> String -> String +withPangoMarkup fg bg font txt = + printf fmt pfn (xmlEscape fg) (xmlEscape bg) (xmlEscape txt) + where pfn = if isPrefixOf "xft:" font then drop 4 font else font + fmt = "%s" -- cgit v1.2.3