D-Bus = Desktop Bus. The Desktop Bus allows applications to talk to one another (IPC and RPC). It is non-transactional, stafeful and connection based.
Major components
There are two major components to D-Bus:
- A dbus library to exchange messages among processes
- dbus daemons which run busses.
A dbus daemon is started via dbus-launch
.
Usually, two bus daemons are running
- the system bus and
- the session bus
The
system bus reports events such as a new
device or changes in some status.
The session bus is the bus over which applications communicate.
Objects
An object is participant of the communcation (an endpoint).
The bus itself is also an object.
Within the D-Bus, objects are uniquely identified by
The bus name identifies a client application that is connected to the bus. Apparently, bus names start with a colon (as in :1.128
) or have a well known name (such as com.foobar.Application
).
The object path identifies an object within that application.
The path looks like a standard Unix file system path (but conisists fo letters, numbers, underscores and forward slashes only).
The bus itself is identified by an address.
TODO
DBUS_SESSION_BUS_ADDRESS
Apparently, the presence of the environment variable DBUS_SESSION_BUS_ADDRESS
indicates whether a D-Bus is available within an X or Wayland session.
dbus-monitor
Monitor the activities in the system and session bus:
$ dbus-monitor --system
$ dbus-monitor --session
dbus-send
dbus-send
sends a message.
dbus-launch
A session bus instance is started with dbus-launch
.
Examples:
dbus-launch --exit-with-session openbox