Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Added support for the new DBus library namely dbus-0.10 #8

merged 2 commits into from

2 participants


The package dbus-core has been deprecated. I have updated the example xmonad.hs to work with dbus-0.10. I am not sure that using package imports is good practice but it is needed if both dbus and dbus-core or the old DBus packages coexists.


No sure if using package imports is good practice, but this is needed in case both dbus and one of dbus-core or DBus packages coexist in one ghc installation.


Thank you for working on this!

Two issues with the patch:

  1. I would rather you drop package imports. DBus name conflict is not a new thing, in addition compiling xmonad fails without passing the -XPackageImports ghc flag.

  2. I'm seeing this error with ghc 7.4.1:

    Couldn't match expected type `D.ObjectPath'
                with actual type `[Char]'
    In the first argument of `D.signal', namely `"/org/xmonad/Log"'
    In the expression:
      (D.signal "/org/xmonad/Log" "org.xmonad.Log" "Update")
    In the expression:
      (D.signal "/org/xmonad/Log" "org.xmonad.Log" "Update")
        {D.signalBody = [D.toVariant
                           ("<b>" ++ (UTF8.decodeString str) ++ "</b>")]}

I have dropped the package imports.

It seems like your xmonad/ghc doesn't understand the LANGUAGE pragma in the header of the file because both compile errors (not compiling without the -XPackageImports flag and the type mismatch between D.ObjectPath and [Char]) are result of not using the Haskell extensions PackageImports and OverloadedStrings respectively.

With ghc 7.4.2 (in my case hiding packages dbus-core and DBus) u-quark@16fc7d2 compiles with no errors.

@alexkay alexkay merged commit f24239e into alexkay:master

I've just tried it on another box and it works there. Merged, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 7 deletions.
  1. +8 −7 xmonad.hs
15 xmonad.hs
@@ -4,7 +4,8 @@ import XMonad
import XMonad.Config.Gnome
import XMonad.Hooks.DynamicLog
-import qualified DBus.Client.Simple as D
+import qualified DBus as D
+import qualified DBus.Client as D
import qualified Codec.Binary.UTF8.String as UTF8
main :: IO ()
@@ -30,15 +31,15 @@ prettyPrinter dbus = defaultPP
getWellKnownName :: D.Client -> IO ()
getWellKnownName dbus = do
D.requestName dbus (D.busName_ "org.xmonad.Log")
- [D.AllowReplacement, D.ReplaceExisting, D.DoNotQueue]
+ [D.nameAllowReplacement, D.nameReplaceExisting, D.nameDoNotQueue]
return ()
dbusOutput :: D.Client -> String -> IO ()
-dbusOutput dbus str = D.emit dbus
- "/org/xmonad/Log"
- "org.xmonad.Log"
- "Update"
- [D.toVariant ("<b>" ++ (UTF8.decodeString str) ++ "</b>")]
+dbusOutput dbus str = do
+ let signal = (D.signal "/org/xmonad/Log" "org.xmonad.Log" "Update") {
+ D.signalBody = [D.toVariant ("<b>" ++ (UTF8.decodeString str) ++ "</b>")]
+ }
+ D.emit dbus signal
pangoColor :: String -> String -> String
pangoColor fg = wrap left right
Something went wrong with that request. Please try again.