dbus: Bus names
2.2 Bus names.
==============
There are several basic functions which inspect the buses for registered
names. Internally they use the basic interface ‘org.freedesktop.DBus’,
which is supported by all objects of a bus.
-- Function: dbus-list-activatable-names &optional bus
This function returns the D-Bus service names, which can be
activated for BUS. It must be either the symbol ‘:system’ (the
default) or the symbol ‘:session’. An activatable service is
described in a service registration file. Under GNU/Linux, such
files are located at ‘/usr/share/dbus-1/system-services/’ (for the
‘:system’ bus) or ‘/usr/share/dbus-1/services/’. An activatable
service is not necessarily registered at BUS at already.
The result is a list of strings, which is ‘nil’ when there are no
activatable service names at all. Example:
;; Check, whether the document viewer can be accessed via D-Bus.
(member "org.gnome.evince.Daemon"
(dbus-list-activatable-names :session))
-- Function: dbus-list-names bus
All service names, which are registered at D-Bus BUS, are returned.
The result is a list of strings, which is ‘nil’ when there are no
registered service names at all. Well known names are strings like
‘org.freedesktop.DBus’. Names starting with ‘:’ are unique names
for services.
BUS must be either the symbol ‘:system’ or the symbol ‘:session’.
-- Function: dbus-list-known-names bus
Retrieves all registered services which correspond to a known name
in BUS. A service has a known name if it doesn’t start with ‘:’.
The result is a list of strings, which is ‘nil’ when there are no
known names at all.
BUS must be either the symbol ‘:system’ or the symbol ‘:session’.
-- Function: dbus-list-queued-owners bus service
For a given service, registered at D-Bus BUS under the name
SERVICE, all queued unique names are returned. The result is a
list of strings, or ‘nil’ when there are no queued names for
SERVICE at all.
BUS must be either the symbol ‘:system’ or the symbol ‘:session’.
SERVICE must be a known service name as string.
-- Function: dbus-get-name-owner bus service
For a given service, registered at D-Bus BUS under the name
SERVICE, the unique name of the name owner is returned. The result
is a string, or ‘nil’ when there exist no name owner of SERVICE.
BUS must be either the symbol ‘:system’ or the symbol ‘:session’.
SERVICE must be a known service name as string.
-- Function: dbus-ping bus service &optional timeout
Check whether the service name SERVICE is registered at D-Bus BUS.
SERVICE might not have been started yet, it is autostarted if
possible. The result is either ‘t’ or ‘nil’.
BUS must be either the symbol ‘:system’ or the symbol ‘:session’.
SERVICE must be a string. TIMEOUT, a nonnegative integer,
specifies the maximum number of milliseconds ‘dbus-ping’ must
return. The default value is 25,000. Example:
(message
"%s screensaver on board."
(cond
((dbus-ping :session "org.gnome.ScreenSaver" 100) "Gnome")
((dbus-ping :session "org.freedesktop.ScreenSaver" 100) "KDE")
(t "No")))
If it shall be checked whether SERVICE is already running without
autostarting it, one shall apply
(member service (dbus-list-known-names bus))
-- Function: dbus-get-unique-name bus
The unique name, under which Emacs is registered at D-Bus BUS, is
returned as string.
BUS must be either the symbol ‘:system’ or the symbol ‘:session’.