summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Text
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-10 04:33:56 +0100
committerjao <jao@gnu.org>2022-09-10 04:33:56 +0100
commitb2d0d19c4b3d33ea336e78c62e7eddfa805281ac (patch)
tree2b42db25b82ffa3e23f702bb0bbb9d19673ff541 /src/Xmobar/Text
parentf81a7cfef463907ba4b68cb1352a869960350685 (diff)
downloadxmobar-b2d0d19c4b3d33ea336e78c62e7eddfa805281ac.tar.gz
xmobar-b2d0d19c4b3d33ea336e78c62e7eddfa805281ac.tar.bz2
cairo: fonts, offsets, colors, actions
Diffstat (limited to 'src/Xmobar/Text')
-rw-r--r--src/Xmobar/Text/Pango.hs6
1 files changed, 4 insertions, 2 deletions
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 = "<span foreground=\"%s\" background=\"%s\">%s</span>"
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)