D-Bus is a simple, message-based protocol for inter-process communication, which allows applications to interact with other parts of the machine and the user's session using remote procedure calls.
D-Bus is a essential part of the modern Linux desktop, where it replaces earlier protocols such as CORBA and DCOP.
This library is an implementation of the D-Bus protocol in Haskell. It can be used to add D-Bus support to Haskell applications, without the awkward interfaces common to foreign bindings.
Example: connect to the session bus, and get a list of active names.
' {-# LANGUAGE OverloadedStrings #-}
import Data.List (sort) import DBus import DBus.Client
main = do   client <- connectSession     -- Request a list of connected clients from the bus   reply <- call_ client (methodCall "/org/freedesktop/DBus" "org.freedesktop.DBus" "ListNames")   { methodCallDestination = Just "org.freedesktop.DBus"   }     -- org.freedesktop.DBus.ListNames() returns a single value, which is   -- a list of names (here represented as [String])   let Just names = fromVariant (methodReturnBody reply !! 0)     -- Print each name on a line, sorted so reserved names are below   -- temporary names.   mapM_ putStrLn (sort names) '
>$ ghc --make list-names.hs >$ ./list-names >:1.0 >:1.1 >:1.10 >:1.106 >:1.109 >:1.110 >ca.desrt.dconf >org.freedesktop.DBus >org.freedesktop.Notifications >org.freedesktop.secrets >org.gnome.ScreenSaver.
Package Version | Update ID | Released | Package Hub Version | Platforms | Subpackages |
---|---|---|---|---|---|
1.2.22-bp156.4.1 info | GA Release | 2024-03-05 | 15 SP6 |
|
|
1.2.22-bp155.2.14 info | GA Release | 2023-05-22 | 15 SP5 |
|
|
1.2.22-bp154.1.16 info | GA Release | 2022-05-09 | 15 SP4 |
|
|
1.2.14-bp153.1.21 info | GA Release | 2021-04-23 | 15 SP3 |
|
|
1.2.14-bp152.1.2 info | GA Release | 2020-05-24 | 15 SP2 |
|
|
1.2.4-bp151.2.2 info | GA Release | 2019-07-18 | 15 SP1 |
|
|
1.2.4-bp151.1.7 info | GA Release | 2019-05-31 | 15 SP1 |
|
|
0.10.13-bp150.2.4 info | GA Release | 2018-08-01 | 15 |
|
|
0.10.13-bp150.2.6 info | GA Release | 2018-07-31 | 15 |
|
|
0.10.13-bp150.2.5 info | GA Release | 2018-07-30 | 15 |
|
|
0.10.12-2.5 info | 5585 | 2016-09-14 | 12 GA-SP5 |
|
|
0.10.12-2.12 info | 5585 | 2016-09-14 | 12 GA-SP5 |
|
|