[xmonad] UTF8 output from xmonad mangled
Ivan Lazar Miljenovic
ivan.miljenovic at gmail.com
Wed Apr 28 05:25:13 EDT 2010
Hi Norbet,
Which version of xmobar are you using?
In previous versions of xmonad-contrib, utf-8 support was optional;
since 0.9.1 it has been mandatory (and hence your version of xmonad
should support it).
However, in xmobar it is still only optional and needs to be built with
--flags=with_utf8 for utf-8 support.
I use xmobar with darcs xmonad (and contrib) and utf-8 works fine; here
is what I use:
,----
| myLogHook panel = do dynamicLogWithPP $ ivanmPP { ppOutput = hPutStrLn panel }
|
| ivanmPP :: PP
| ivanmPP = defaultPP { ppCurrent = xmobarColor "green" "" . wrap "[" "]" . addIndex
| , ppVisible = xmobarColor "blue" "" . wrap "(" ")" . addIndex
| , ppHidden = addIndex
| , ppHiddenNoWindows = xmobarColor "tan" "" . addIndex
| , ppUrgent = xmobarColor "red" "black" . pad
| , ppLayout = xmobarColor "sienna" ""
| , ppSep = pad $ xmobarColor "VioletRed" "" "※"
| , ppWsSep = xmobarColor "gray" "" $ pad "Ѻ"
| , ppTitle = xmobarColor "green" "" . shorten 40
| , ppExtras = maildirs
| , ppOrder = \ (ws:l:_:es) -> ws : l : es
| }
| where
| addIndex x = (show . (+1) . fromJust . findIndex (x==)) myWorkspaces ++ " : " ++ x
|
| maildirs = map ($ "/home/ivan/Maildir/") [maildirUnread, maildirNew]
`----
In case you can't see them, there are utf-8 characters in ppSep and ppWsSep.
Norbert Zeh <nzeh at cs.dal.ca> writes:
> Hi folks,
>
> I'm using xmobar as my status bar and have problems to get UTF8
> characters to display correctly. I did the following tests:
>
> 1. Start xmobar, reading input from stdin. Type in some unicode
> characters. Xmobar displays them fine.
>
> 2. Add some unicode characters to my loghook in xmonad. Things come
> out garbled.
>
> 3. Instead of piping to xmobar, make xmonad write to a file. The file
> contents are also garbled. To be more precise, they are exactly what
> xmobar shows me in the second test.
>
> So this seems like the problem is on xmonad's end, not xmobar's. I'm
> running the latest darcs version of xmonad. Any ideas what could be
> causing this?
>
> Thanks,
> Norbert
> _______________________________________________
> xmonad mailing list
> xmonad at haskell.org
> http://www.haskell.org/mailman/listinfo/xmonad
--
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com
More information about the xmonad
mailing list