10 Monitoring messages.

Function: dbus-register-monitor bus &optional handler &key type sender destination path interface member

This function registers handler for monitoring messages on the D-Bus bus.

bus is either a Lisp keyword, :system or :session, or a string denoting the bus address.

handler is the function to be called when a D-Bus event to be monitored arrives. It is called with the args slot of the D-Bus event (see Errors and events.), which are stripped off the type keywords. If handler is nil, the default handler dbus-monitor-handler is applied. This default handler behaves similar to the dbus-monitor program.

The other arguments are keyword-value pairs. :type type defines the message type to be monitored. If given, it must be equal one of the strings ‘method_call’, ‘method_return’, ‘error’ or ‘signal’.

:sender sender and :destination destination are D-Bus names. They can be unique names, or well-known service names.

:path path is the D-Bus object to be monitored. :interface interface is the name of an interface, and :member member is either a method name, a signal name, or an error name.

dbus-register-monitor returns a Lisp object, which can be used as argument in dbus-unregister-object for removing the monitor.

The following form shows all D-Bus events on the session bus in buffer ‘*D-Bus Monitor*’:

(dbus-register-monitor :session)

And this form restricts the monitoring on D-Bus errors:

(dbus-register-monitor :session nil :type "error")
Command: dbus-monitor &optional bus

This command invokes dbus-register-monitor interactively, and switches to the monitor buffer.