dbus

This is an old revision of the document!


DBUS

Sources: Wikipedia, D-Bus Specification, Cardinal Peak

D-BUS is an Inter-Process Communication (IPC) specification. Communication is possible via multiple Transports (e.g., Unix sockets, systemd, TCP sockets).

Default D-Bus message buses:

  • System-wide instance / message bus (see /usr/share/dbus-1/system.conf or dbus-monitor --system)
  • User-session-specific instance / message bus (see /usr/share/dbus-1/session.conf or dbus-monitor --session)

Monitor DBUS signals: dbus-monitor

  • GDBus (Gnome)
  • QT/KDE D-Bus
  • dbus-broker (default on Arch)

Source: dbus-broker package

  • Each dbus-broker instance provides a message bus
  • Each dbus-broker instance gets started by a parent process (Controller) (e.g., dbus-broker-launch)
  • dbus-broker only implements message mediation (bus setup and external communication needs to be handled by the Controller.
  • The Controller hands over a unix socket (as file descriptor FD) to the dbus-broker instance (--controller=FD)
  • The unix socket is used by dbus-broker to accept control commands from the Controller and to create interfa

dbus-broker on Arch Linux

Source: Arch Wiki

dbus

  • Send desktop notification: notify-send test
  • Send desktop notification with icon: notify-send -i face-glasses "test" (icons are located in /usr/share/icons/)
  • Monitor DBUS desktop notifications: dbus-monitor "interface='org.freedesktop.Notifications'"

Primary source

Daemons:

  • dunst
  • NotifyOSD / notify-osd

Depending on the Desktop Environment, notification daemons are built-in (Cinnamon, Gnome, KDE). Notification daemons can started standalone for other environments (e.g. i3wm). Standalone is possible via XDG autostart or as DBUS service.

Typically, DBUS service files are shipped with notification daemons, e.g., /usr/share/dbus-1/services/org.freedesktop.Notifications.service

Tools:

  • Bustle: Recording D-Bus communication, drawing sequence diagrams, inspecting communication
  • D-Spy: Inspect buses/interfaces/properties/signals.methods, execute methods (e.g., send test desktop notifications)
  • dbus.1742733279.txt.gz
  • Last modified: 2025/03/23 13:34
  • by tmaier