Permalink
Browse files

Added support for the new DBus library namely dbus-0.10

  • Loading branch information...
1 parent 1100898 commit 8948b2aa23d5ce0542ce5fffeec6948167a01c91 @u-quark committed Jul 26, 2012
Showing with 9 additions and 8 deletions.
  1. +9 −8 xmonad.hs
View
17 xmonad.hs
@@ -1,10 +1,11 @@
-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE OverloadedStrings, PackageImports #-}
import XMonad
import XMonad.Config.Gnome
import XMonad.Hooks.DynamicLog
-import qualified DBus.Client.Simple as D
+import qualified "dbus" DBus as D
@u-quark
u-quark Jul 26, 2012

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.

+import qualified "dbus" 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

0 comments on commit 8948b2a

Please sign in to comment.