From e4ddbe7d649c618b2c78f33102c7f5855205f501 Mon Sep 17 00:00:00 2001 From: jao Date: Tue, 8 Feb 2022 00:34:25 +0000 Subject: Linting --- src/Xmobar/Text/Pango.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Xmobar/Text/Pango.hs b/src/Xmobar/Text/Pango.hs index 30ec76f..609e3b1 100644 --- a/src/Xmobar/Text/Pango.hs +++ b/src/Xmobar/Text/Pango.hs @@ -35,13 +35,14 @@ withPangoColor (fg, bg) s = printf fmt (xmlEscape fg) (xmlEscape bg) (xmlEscape s) where fmt = "%s" +fixXft :: String -> String +fixXft font = if "xft:" `isPrefixOf` font then drop 4 font else font + withPangoFont :: String -> String -> String -withPangoFont font txt = printf fmt pfn (xmlEscape txt) +withPangoFont font txt = printf fmt (fixXft font) (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" + printf fmt (fixXft font) (xmlEscape fg) (xmlEscape bg) (xmlEscape txt) + where fmt = "%s" -- cgit v1.2.3