LinuxCommandLibrary

gdbus

Interact with D-Bus services

TLDR

List all names on the session bus

$ gdbus list-names --session
copy

List all names on the system bus
$ gdbus list-names --system
copy

Introspect an object to see its interfaces and methods
$ gdbus introspect --session --dest [destination_bus_name] --object-path /[path/to/object]
copy

Call a method on an object with arguments
$ gdbus call --session --dest [destination_bus_name] --object-path /[path/to/object] --method [interface.method_name] [argument1 argument2 ...]
copy

Emit a signal from an object with arguments
$ gdbus emit --session --object-path /[path/to/object] --signal [interface.signal_name] [argument1 argument2 ...]
copy

Monitor all messages on the session bus
$ gdbus monitor --session
copy

SYNOPSIS

gdbus [OPTION...] SUBCOMMAND [ARG...]
where SUBCOMMAND is call, emit, introspect, monitor, object-manager, help, or version.

PARAMETERS

--session
    Connect to the user session bus (default)

--system
    Connect to the systemwide D-Bus instance

--address=<ADDRESS>
    Use D-Bus server at custom ADDRESS

--help
    Print usage summary

--version
    Display GIO/GDBus version information

DESCRIPTION

gdbus is a command-line utility from the GLib library's GIO framework, designed for interacting with D-Bus interprocess communication. It enables introspection of remote D-Bus objects, invocation of methods, emission of signals, monitoring of bus activity, and management of object hierarchies.

Primarily used for debugging, testing, and scripting D-Bus services on Linux systems—especially GNOME environments—gdbus handles complex data via GVariant format, supporting session, system, or custom bus connections. Its human-readable syntax simplifies tasks that would otherwise require programming.

For example, developers can inspect interfaces, call methods with typed arguments, or eavesdrop on signals without compiling code. Integrated with modern desktop buses, it complements tools like D-Bus activation for seamless service interaction.

CAVEATS

Subcommand-specific options apply; GVariant types required for complex args. Not for production; prefer libraries for apps.

SUBCOMMANDS

call: Invoke method e.g. gdbus call ...
emit: Emit signal.
introspect: Dump XML interface.
monitor: Watch object traffic.
object-manager: Track object paths.

EXAMPLE

gdbus introspect --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus
Introspects the bus root object.

HISTORY

Introduced in GLib 2.26 (March 2010) as part of GIO to simplify D-Bus CLI access, evolving with GLib for better GVariant support and object manager features.

SEE ALSO

Copied to clipboard