To control a D-Bus-enabled application, you need the interface definition to find out which methods are offered and which parameters they expect.
Of course, you can get the relevant interface definition from the application’s source distribution. But there’s an easier way: Ask the object in question via D-Bus to give you the interface description. All objects implementing the org.freedesktop.DBus.Introspectable
interface offer an Introspect()
method that returns an XML document describing the methods and their signatures.
Instead of python, we’ll use the dbus-send
command line utility this time. The following command dumps the definition of rhythmbox’ /org/gnome/Rhythmbox/Player
object:
dbus-send --session --type=method_call --print-reply --dest=org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player org.freedesktop.DBus.Introspectable.Introspect
The service to query is org.gnome.Rhythmbox
and the object’s interface is org.freedesktop.DBus.Introspectable
. Note that for dbus-send
, the method’s name (Introspect
here) has to be appended to the interface. See the dbus-send manpage for more information, like calling methods with parameters.
I’m looking for such an article. Thanks alot :)
Pingback: daveg :: weblog » Blog Archive » Rhythmbox from the command line
This article had ended my problems, Now I can start working on DBus
Cool, but can i somehow find out what objects are exported by say org.kde.plasma ?
Nice, just what I was looking for
Pingback: Patching Pidgin: itch-scratching with Pidgin's D-Bus API - Tom Lee
Pingback: certmonger D-Bus introspection | Frustrations