From b2d0d19c4b3d33ea336e78c62e7eddfa805281ac Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 10 Sep 2022 04:33:56 +0100 Subject: cairo: fonts, offsets, colors, actions --- src/Xmobar/Text/Pango.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Xmobar/Text') diff --git a/src/Xmobar/Text/Pango.hs b/src/Xmobar/Text/Pango.hs index 609e3b1..a3fc899 100644 --- a/src/Xmobar/Text/Pango.hs +++ b/src/Xmobar/Text/Pango.hs @@ -15,7 +15,8 @@ -- ------------------------------------------------------------------------------ -module Xmobar.Text.Pango (withPangoColor, withPangoFont, withPangoMarkup) where +module Xmobar.Text.Pango (withPangoColor, withPangoFont, withPangoMarkup, fixXft) +where import Text.Printf (printf) import Data.List (isPrefixOf) @@ -36,7 +37,8 @@ withPangoColor (fg, bg) s = where fmt = "%s" fixXft :: String -> String -fixXft font = if "xft:" `isPrefixOf` font then drop 4 font else font +fixXft font = + if "xft:" `isPrefixOf` font then replaceAll '-' " " $ drop 4 font else font withPangoFont :: String -> String -> String withPangoFont font txt = printf fmt (fixXft font) (xmlEscape txt) -- cgit v1.2.3