The February 2005 issue of Linux Journal contains a gem of an article by Robert Love called Get on the D-BUS. I didn’t notice it until I was trawling through the ACM Digital Library while working on a paper for my computer organization class. All tangents aside it’s a great article and anyone who uses Linux on the desktop should check it out, as I think that you’re going to see D-BUS do a lot of heavy lifting over the next few years.
I’d strongly suggest reading the LJ article for a full definition, but to summarize: D-BUS is an interprocess communications system that is (or soon will be) used in both Gnome and KDE environments. It allows apps to send and receive messages to and from each other in a happy object-oriented easy-as-it-should-be way. The Gnome Mono codemonkeys are using it with Beagle, and probably other apps. There’s a D-BUS package and several apps that use it backed in to Hoary. There’s even a Security Enhanced DBUS built in to Security Enhanced Linux.
The APIs and the software are under constant development, but there are already working libraries for C, Glib, and (yes I checked) even python. Here’s example-client.py (edited slightly to fit in my layout):
#!/usr/bin/env python import dbus bus = dbus.SessionBus() remote_service = bus.get_service("org.designfu.SampleService") remote_object = remote_service.get_object("/SomeObject", "org.designfu.SampleInterface") hello_reply_list = remote_object.HelloWorld("Hello!") hello_reply_tuple = remote_object.GetTuple() hello_reply_dict = remote_object.GetDict() print (hello_reply_list) print str(hello_reply_tuple) print str(hello_reply_dict)
It looks like D-BUS (or DBUS if you would prefer to abbreviate it that way) is going to be adopted in both the Gnome and KDE camps, which is A Good Thing. I think that it is going to lead to better interaction with applications on the desktop. I imagine a sexy Growl workalike telling me about all kinds of things that I may or may not want to know in a cute and unobtrustive way. As the technology is adopted, I see apps talking to one another and reacting to one another more and more. I see apps and frameworks taking advantage of external web services flowing over DBUS.
Keep an eye on this list of apps that use D-BUS expand quickly.