alexkay / xmonad-log-applet

An applet that will display Xmonad log information
https://github.com/alexkay/xmonad-log-applet
BSD 3-Clause "New" or "Revised" License
59 stars 17 forks source link

Updating the example xmonad.hs file to use dbus-core #6

Closed nguyentito closed 12 years ago

nguyentito commented 12 years ago

The updated file now works with the latest version of the dbus-core Haskell library (http://hackage.haskell.org/package/dbus-core), which removes the dependency on the unmaintained DBus package (http://hackage.haskell.org/package/DBus).

I also ran into the issue someone mentioned on the bug tracker about Unicode characters. I think what happens is that the DBus serialization functions expect to receive a "normal" Haskell string (i.e. a list of unicode characters) whereas the string given to the pretty printer by XMonad is actually a list of 8-bit words which correspond to the UTF-8 encoding of the actual text. Using the decodeString function from the utf8-string library (upon which XMonad already depends) fixes the problem (at least, it does for me). The person who posted the bug report must have been mislead by the fact that the UTF-8 and ISO-8859-1 encodings are the same for a string with only European characters.

So this patch solves both issue #4 and issue #5 :-)

alexkay commented 12 years ago

Unfortunately this doesn't work for me, I'm seeing this error when running xmonad --restart:

Data.ByteString.head: empty ByteString

Any idea what could cause this?

nguyentito commented 12 years ago

Since you mentioned on the issue #5 discussion you weren't affected by it, I'd suggest removing the call to UTF8.decodeString. What configuration are you using ? I have the latest distro packages from the ubuntu 12.04 beta (so ghc 7.4 and xmonad 0.10) + the cabal-installed dbus-core 0.9.2.1.

alexkay commented 12 years ago

Sorry for the false alarm, must be an issue with my FreeBSD and/or GNOME2 installation. The config file works fine in Debian testing under GNOME3.

Thanks for the patch!