Documentation on using DBus with Python via GOI is rather thin. I have found this example in GJS, but when rewritten straight into Python it didn’t work.

Example in GJS:

const GLib =;
const Gio =;

const DBusDaemonIface = <interface name='org.freedesktop.DBus'>
    <method name='ListNames'>
            <arg type='as' direction='out'/>

const DBusDaemonProxy = Gio.DBusProxy.makeProxyWrapper(DBusDaemonIface);

let main = function () {
    var gdbusProxy = new DBusDaemonProxy(Gio.DBus.session,
        'org.freedesktop.DBus', '/org/freedesktop/DBus');
    gdbusProxy.ListNamesRemote(function(result, error){

    var main_loop = new GLib.MainLoop(null, true);;


The answer which helped was looking into which is a way better example of using Gio.DBusProxy machinery.

Example in Python:

   1 from gi.repository import Gio
   4       bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
   5       proxy = Gio.DBusProxy.new_sync(bus, Gio.DBusProxyFlags.NONE, None,
   6                                      'org.freedesktop.DBus',
   7                                      '/org/freedesktop/DBus',
   8                                      'org.freedesktop.DBus', None)
   9       res = proxy.call_sync('ListNames', None, Gio.DBusCallFlags.NO_AUTO_START,
  10                             500, None)
  11       print(res)

HowDoI/GDBusPython (last edited 2014-09-17 16:26:11 by MatejCepl)