Package Info

ghc-dbus


A client library for the D-Bus IPC system


Unspecified

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 &#x20; client <- connectSession &#x20; // &#x20; -- Request a list of connected clients from the bus &#x20; reply <- call_ client (methodCall "/org/freedesktop/DBus" "org.freedesktop.DBus" "ListNames") &#x20; &#x7b; methodCallDestination = Just "org.freedesktop.DBus" &#x20; &#x7d; &#x20; // &#x20; -- org.freedesktop.DBus.ListNames() returns a single value, which is &#x20; -- a list of names (here represented as [String]) &#x20; let Just names = fromVariant (methodReturnBody reply !! 0) &#x20; // &#x20; -- Print each name on a line, sorted so reserved names are below &#x20; -- temporary names. &#x20; 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.


License: Apache-2.0
URL: https://hackage.haskell.org/package/dbus

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
1.2.22-bp154.1.16 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • x86-64
  • ghc-dbus
  • ghc-dbus-devel
1.2.14-bp153.1.21 info GA Release 2021-04-23 15 SP3
  • AArch64
  • ppc64le
  • x86-64
  • ghc-dbus
  • ghc-dbus-devel
1.2.14-bp152.1.2 info GA Release 2020-05-24 15 SP2
  • AArch64
  • ppc64le
  • x86-64
  • ghc-dbus
  • ghc-dbus-devel
1.2.4-bp151.2.2 info GA Release 2019-07-18 15 SP1
  • ppc64le
  • x86-64
  • ghc-dbus
  • ghc-dbus-devel
1.2.4-bp151.1.7 info GA Release 2019-05-31 15 SP1
  • AArch64
  • ghc-dbus
  • ghc-dbus-devel
0.10.13-bp150.2.4 info GA Release 2018-08-01 15
  • AArch64
  • ghc-dbus
  • ghc-dbus-devel
0.10.13-bp150.2.6 info GA Release 2018-07-31 15
  • ppc64le
  • ghc-dbus
  • ghc-dbus-devel
0.10.13-bp150.2.5 info GA Release 2018-07-30 15
  • x86-64
  • ghc-dbus
  • ghc-dbus-devel
0.10.12-2.12 info 5585 2016-09-14 12 GA-SP5
  • AArch64
  • s390x
  • x86-64
  • ghc-dbus
  • ghc-dbus-devel
0.10.12-2.5 info 5585 2016-09-14 12 GA-SP5
  • ppc64le
  • ghc-dbus
  • ghc-dbus-devel