.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "GDBUS" "" "" "" .SH NAME gdbus \- Tool for working with D-Bus objects .\" This has to be duplicated from above to make it machine-readable by `reuse`: .\" SPDX-FileCopyrightText: 2010, 2011, 2012, 2020 Red Hat, Inc. .\" SPDX-FileCopyrightText: 2015 Collabora, Ltd. .\" SPDX-FileCopyrightText: 2021 Endless OS Foundation, LLC .\" SPDX-License-Identifier: LGPL-2.1-or-later . .SH SYNOPSIS .nf \fBgdbus\fP introspect [\-\-system | \-\-session | \-\-address \fIaddress\fP] \-\-dest \fIbus_name\fP \-\-object\-path \fI/path/to/object\fP [\-\-xml] [\-\-recurse] [\-\-only\-properties] \fBgdbus\fP monitor [\-\-system | \-\-session | \-\-address \fIaddress\fP] \-\-dest \fIbus_name\fP [\-\-object\-path \fI/path/to/object\fP] \fBgdbus\fP call [\-\-system | \-\-session | \-\-address \fIaddress\fP] \-\-dest \fIbus_name\fP \-\-object\-path \fI/path/to/object\fP \-\-method \fIorg.project.InterfaceName.MethodName\fP [\-\-timeout \fIseconds\fP | \-\-interactive] [\fIARG\fP…] \fBgdbus\fP emit [\-\-system | \-\-session | \-\-address \fIaddress\fP] \-\-object\-path \fI/path/to/object\fP \-\-signal \fIorg.project.InterfaceName.SignalName\fP [\-\-dest \fIunique_bus_name\fP] [\fIARG\fP…] \fBgdbus\fP wait [\-\-system | \-\-session | \-\-address \fIaddress\fP] \-\-activate \fIbus_name\fP [\-\-timeout \fIseconds\fP] \fIbus_name\fP \fBgdbus\fP help .fi .sp .SH DESCRIPTION .sp \fBgdbus\fP is a simple tool for working with D\-Bus objects. .SH COMMANDS .sp \fBintrospect\fP .INDENT 0.0 .INDENT 3.5 Prints out interfaces and property values for a remote object. For this to work, the owner of the object needs to implement the \fBorg.freedesktop.DBus.Introspectable\fP interface. If the \fB\-\-xml\fP option is used, the returned introspection XML is printed, otherwise a parsed pretty representation is printed. The \fB\-\-recurse\fP option can be used to introspect children (and their children and so on) and the \fB\-\-only\-properties\fP option can be used to only print the interfaces with properties. .UNINDENT .UNINDENT .sp \fBmonitor\fP .INDENT 0.0 .INDENT 3.5 Monitors one or all objects owned by the owner of \fBbus_name\fP\&. .UNINDENT .UNINDENT .sp \fBcall\fP .INDENT 0.0 .INDENT 3.5 Invokes a method on a remote object. Each argument to pass to the method must be specified as a serialized \fBGVariant\fP except that strings do not need explicit quotes. The return values are printed out as serialized \fBGVariant\fP values. .UNINDENT .UNINDENT .sp \fBemit\fP .INDENT 0.0 .INDENT 3.5 Emits a signal. Each argument to include in the signal must be specified as a serialized \fBGVariant\fP except that strings do not need explicit quotes. .UNINDENT .UNINDENT .sp \fBwait\fP .INDENT 0.0 .INDENT 3.5 Waits until \fBbus_name\fP is owned by some process on the bus. If the \fB\-\-activate\fP is specified, that bus name will be auto\-started first. It may be the same as the bus name being waited for, or different. .UNINDENT .UNINDENT .sp \fBhelp\fP .INDENT 0.0 .INDENT 3.5 Prints help and exits. .UNINDENT .UNINDENT .SH BASH COMPLETION .sp \fBgdbus\fP ships with a bash completion script to complete commands, destinations, bus names, object paths and interface/method names. .SH EXAMPLES .sp This shows how to introspect an object — note that the value of each property is displayed: .INDENT 0.0 .INDENT 3.5 .sp .EX $ gdbus introspect \-\-system \e \-\-dest org.freedesktop.NetworkManager \e \-\-object\-path /org/freedesktop/NetworkManager/Devices/0 node /org/freedesktop/NetworkManager/Devices/0 { interface org.freedesktop.DBus.Introspectable { methods: Introspect(out s data); }; interface org.freedesktop.DBus.Properties { methods: Get(in s interface, in s propname, out v value); Set(in s interface, in s propname, in v value); GetAll(in s interface, out a{sv} props); }; interface org.freedesktop.NetworkManager.Device.Wired { signals: PropertiesChanged(a{sv} arg_0); properties: readonly b Carrier = false; readonly u Speed = 0; readonly s HwAddress = \(aq00:1D:72:88:BE:97\(aq; }; interface org.freedesktop.NetworkManager.Device { methods: Disconnect(); signals: StateChanged(u arg_0, u arg_1, u arg_2); properties: readonly u DeviceType = 1; readonly b Managed = true; readwrite o Ip6Config = \(aq/\(aq; readwrite o Dhcp4Config = \(aq/\(aq; readwrite o Ip4Config = \(aq/\(aq; readonly u State = 2; readwrite u Ip4Address = 0; readonly u Capabilities = 3; readonly s Driver = \(aqe1000e\(aq; readwrite s Interface = \(aqeth0\(aq; readonly s Udi = \(aq/sys/devices/pci0000:00/0000:00:19.0/net/eth0\(aq; }; }; .EE .UNINDENT .UNINDENT .sp The \fB\-\-recurse\fP and \fB\-\-only\-properties\fP options can be useful when wanting to inspect all objects owned by a particular process: .INDENT 0.0 .INDENT 3.5 .sp .EX $ gdbus introspect \-\-system \-\-dest org.freedesktop.UPower \-\-object\-path / \-\-recurse \-\-only\-properties node / { node /org { node /org/freedesktop { node /org/freedesktop/UPower { interface org.freedesktop.UPower { properties: readonly b IsDocked = true; readonly b LidForceSleep = false; readonly b LidIsPresent = false; readonly b LidIsClosed = false; readonly b OnLowBattery = false; readonly b OnBattery = false; readonly b CanHibernate = true; readonly b CanSuspend = true; readonly s DaemonVersion = \(aq0.9.10\(aq; }; node /org/freedesktop/UPower/Policy { }; node /org/freedesktop/UPower/Wakeups { interface org.freedesktop.UPower.Wakeups { properties: readonly b HasCapability = true; }; }; }; }; }; }; .EE .UNINDENT .UNINDENT .sp In a similar fashion, the \fBintrospect\fP command can be used to learn details about the \fBNotify\fP method: .INDENT 0.0 .INDENT 3.5 .sp .EX […] interface org.freedesktop.Notifications { methods: GetServerInformation(out s return_name, out s return_vendor, out s return_version, out s return_spec_version); GetCapabilities(out as return_caps); CloseNotification(in u id); Notify(in s app_name, in u id, in s icon, in s summary, in s body, in as actions, in a{sv} hints, in i timeout, out u return_id); }; […] .EE .UNINDENT .UNINDENT .sp With this information, it’s easy to use the \fBcall\fP command to display a notification: .INDENT 0.0 .INDENT 3.5 .sp .EX $ gdbus call \-\-session \e \-\-dest org.freedesktop.Notifications \e \-\-object\-path /org/freedesktop/Notifications \e \-\-method org.freedesktop.Notifications.Notify \e my_app_name \e 42 \e gtk\-dialog\-info \e \(dqThe Summary\(dq \e \(dqHere’s the body of the notification\(dq \e [] \e {} \e 5000 (uint32 12,) .EE .UNINDENT .UNINDENT .sp Call a method with file handle argument: .INDENT 0.0 .INDENT 3.5 .sp .EX $ gdbus call \-\-session \e \-\-dest org.example.foo \e \-\-object\-path /org/example/foo \e \-\-method SendFDs \e 1 \e 10 \e 10},) /org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({\(aqStrength\(aq: },) /org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({\(aqStrength\(aq: },) /org/freedesktop/NetworkManager/AccessPoint/4141: org.freedesktop.NetworkManager.AccessPoint.PropertiesChanged ({\(aqStrength\(aq: },) .EE .UNINDENT .UNINDENT .sp Emitting a signal: .INDENT 0.0 .INDENT 3.5 .sp .EX $ gdbus emit \-\-session \-\-object\-path /foo \-\-signal org.bar.Foo \(dq[\(aqfoo\(aq, \(aqbar\(aq, \(aqbaz\(aq]\(dq .EE .UNINDENT .UNINDENT .sp Emitting a signal to a specific process: .INDENT 0.0 .INDENT 3.5 .sp .EX $ gdbus emit \-\-session \-\-object\-path /bar \-\-signal org.bar.Bar someString \-\-dest :1.42 .EE .UNINDENT .UNINDENT .sp Waiting for a well\-known name to be owned on the bus; this will \fInot\fP auto\-start the service: .INDENT 0.0 .INDENT 3.5 .sp .EX $ gdbus wait \-\-session org.bar.SomeName .EE .UNINDENT .UNINDENT .sp Auto\-starting then waiting for a well\-known name to be owned on the bus: .INDENT 0.0 .INDENT 3.5 .sp .EX $ gdbus wait \-\-session \-\-activate org.bar.SomeName .EE .UNINDENT .UNINDENT .sp Auto\-starting a different service, then waiting for a well\-known name to be owned on the bus. This is useful in situations where \fBSomeName\fP is not directly activatable: .INDENT 0.0 .INDENT 3.5 .sp .EX $ gdbus wait \-\-session \-\-activate org.bar.PrerequisiteName org.bar.SomeName .EE .UNINDENT .UNINDENT .sp Waiting for a well\-known name and giving up after 30 seconds. By default, the timeout is disabled; or set \fB\-\-timeout\fP to \fB0\fP to disable it: .INDENT 0.0 .INDENT 3.5 .sp .EX $ gdbus wait \-\-session \-\-timeout 30 org.bar.SomeName .EE .UNINDENT .UNINDENT .SH BUGS .sp Please send bug reports to either the distribution bug tracker or the upstream bug tracker \&. .SH SEE ALSO .sp .\" Generated by docutils manpage writer. .