summaryrefslogtreecommitdiffhomepage
path: root/src/XUtil.hsc
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2015-05-04 19:14:59 +0200
committerjao <jao@gnu.org>2015-05-04 19:14:59 +0200
commit8dd06b986d25230edec260d68426b25a6284744d (patch)
tree5cf6fddec2636107c7b733ae43ddabcbf479de86 /src/XUtil.hsc
parenta8c4ca8133b7ab0852cb542a63dc219dbd207360 (diff)
parentf182c43ceab950cea54a968af5d57470aadbec15 (diff)
downloadxmobar-8dd06b986d25230edec260d68426b25a6284744d.tar.gz
xmobar-8dd06b986d25230edec260d68426b25a6284744d.tar.bz2
Merge branch 'master' of https://github.com/ahgilbert/xmobar
Diffstat (limited to 'src/XUtil.hsc')
-rw-r--r--src/XUtil.hsc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/XUtil.hsc b/src/XUtil.hsc
index 9cb1def..e37d419 100644
--- a/src/XUtil.hsc
+++ b/src/XUtil.hsc
@@ -33,6 +33,7 @@ import Control.Concurrent
import Control.Monad (when)
import Control.Monad.Trans
import Control.Exception (SomeException, handle)
+import Data.List
import Foreign
import Graphics.X11.Xlib hiding (textExtents, textWidth)
import qualified Graphics.X11.Xlib as Xlib (textExtents, textWidth)
@@ -49,7 +50,6 @@ import qualified System.IO as UTF8 (readFile,hGetLine)
# endif
#endif
#if defined XFT
-import Data.List
import MinXft
import Graphics.X11.Xrender
#endif
@@ -81,12 +81,18 @@ data XFont = Core FontStruct
-- to the Xft backend Example: 'xft:Sans-10'
initFont :: Display ->String -> IO XFont
initFont d s =
-#ifdef XFT
let xftPrefix = "xft:" in
if xftPrefix `isPrefixOf` s then
+#ifdef XFT
fmap Xft $ initXftFont d s
- else
+#else
+ do
+ hPutStrLn stderr $ "Warning: Xmobar must be built with "
+ ++ "the with_xft flag to support font '" ++ s
+ ++ ".' Falling back on default."
+ initFont d miscFixedFont
#endif
+ else
#if defined UTF8 || __GLASGOW_HASKELL__ >= 612
fmap Utf8 $ initUtf8Font d s
#else