LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gdbus

command-line tool for D-Bus introspection and interaction

TLDR

List the names currently on the session bus
$ gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames
copy
Show an object's interfaces, methods and properties
$ gdbus introspect --session --dest [org.example.Service] --object-path /[org/example/Object]
copy
Print the raw introspection XML
$ gdbus introspect --session --dest [service] --object-path /[path] --xml
copy
Walk the whole object tree below a path
$ gdbus introspect --session --dest [service] --object-path / --recurse
copy
Show only the interfaces that carry properties
$ gdbus introspect --session --dest [service] --object-path /[path] --only-properties
copy
Call a method, passing arguments as serialized GVariant
$ gdbus call --session --dest [service] --object-path /[path] --method [org.example.Iface.Method] [argument]
copy
Call a method on the system bus instead
$ gdbus call --system --dest [service] --object-path /[path] --method [method]
copy
Allow a slow call longer than the default timeout
$ gdbus call --session --dest [service] --object-path /[path] --method [method] --timeout [30]
copy
Emit a signal
$ gdbus emit --session --object-path /[path] --signal [org.example.Iface.Signal] [argument]
copy
Watch the traffic belonging to one service
$ gdbus monitor --session --dest [service]
copy
Block until a service appears on the bus
$ gdbus wait --session [org.example.Service]
copy

SYNOPSIS

gdbus command [options]

DESCRIPTION

gdbus is a command-line tool for interacting with D-Bus, the inter-process communication system used extensively in Linux desktop environments. It's part of GLib and provides a way to inspect, call methods on, and monitor D-Bus objects.The session bus is used for user applications (desktop notifications, media players, etc.), while the system bus handles system-wide services (NetworkManager, UPower, etc.).Use introspect to discover available interfaces and methods on any D-Bus object before interacting with it.

PARAMETERS

introspect

Introspect a remote object
call
Invoke a method on a remote object
emit
Emit a signal
monitor
Monitor a remote object
wait
Wait for a bus name to appear
--session
Connect to the session bus (user-specific)
--system
Connect to the system bus (system-wide)
--dest NAME
Destination bus name
--object-path PATH
D-Bus object path
--method INTERFACE.METHOD
Method to call
--signal INTERFACE.SIGNAL
Signal to emit

INSTALL

sudo apt install libglib2.0-bin
copy
sudo dnf install glib
copy
sudo apk add glib
copy
brew install glib
copy
nix profile install nixpkgs#glib
copy

CAVEATS

D-Bus method signatures must match exactly. Complex types require proper GVariant formatting. Some system bus operations require elevated privileges or PolicyKit authorization.

HISTORY

gdbus was introduced as part of GLib's GDBus implementation in 2010 (GLib 2.26), replacing the older dbus-glib bindings. It provides a more modern, GObject-based interface to D-Bus.

SEE ALSO

dbus-send(1), busctl(1), qdbus(1)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid