diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2008-03-16 13:11:00 +0100 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2008-03-16 13:11:00 +0100 |
commit | 5b753d8c1aa2ce271fb15b7c9aa1af83f8de0d3a (patch) | |
tree | bdde146cd302b48910d79e627f6790a8b4dd50b9 /Plugins | |
parent | ff8ef5fa74fb5bce3dcb82ef1cd81e0d123d0ac1 (diff) | |
download | xmobar-5b753d8c1aa2ce271fb15b7c9aa1af83f8de0d3a.tar.gz xmobar-5b753d8c1aa2ce271fb15b7c9aa1af83f8de0d3a.tar.bz2 |
add XFT support and make UTF-8 support configurable
This patch includes many changes:
- moved font and printing functions to XUtil.hs and created an
abstraction layer to font management;
- ported the core, StdinReader and PipeReader to the new font
management system.
To enable UTF-8 support configure with the "with_utf8" flag (requires
utf8-string):
runhaskell Setup.lhs configure --flags
darcs-hash:20080316121100-d6583-828134da356b706744b56a9d81203129b0e8e484.gz
Diffstat (limited to 'Plugins')
-rw-r--r-- | Plugins/PipeReader.hs | 3 | ||||
-rw-r--r-- | Plugins/StdinReader.hs | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/Plugins/PipeReader.hs b/Plugins/PipeReader.hs index 6c84f71..a0709b1 100644 --- a/Plugins/PipeReader.hs +++ b/Plugins/PipeReader.hs @@ -15,7 +15,6 @@ module Plugins.PipeReader where import System.IO -import qualified System.IO.UTF8 as U import Plugins data PipeReader = PipeReader String String @@ -25,5 +24,5 @@ instance Exec PipeReader where alias (PipeReader _ a) = a start (PipeReader p _) cb = do h <- openFile p ReadMode - forever (U.hGetLine h >>= cb) + forever (hGetLineSafe h >>= cb) where forever a = a >> forever a diff --git a/Plugins/StdinReader.hs b/Plugins/StdinReader.hs index 4283a96..a12b722 100644 --- a/Plugins/StdinReader.hs +++ b/Plugins/StdinReader.hs @@ -18,7 +18,6 @@ import Prelude hiding (catch) import System.Posix.Process import System.Exit import System.IO -import qualified System.IO.UTF8 as U import Control.Exception (catch) import Plugins @@ -27,7 +26,7 @@ data StdinReader = StdinReader instance Exec StdinReader where start StdinReader cb = do - cb =<< catch (U.hGetLine stdin) (\e -> do hPrint stderr e; return "") + cb =<< catch (hGetLineSafe stdin) (\e -> do hPrint stderr e; return "") eof <- hIsEOF stdin if eof then exitImmediately ExitSuccess |