Gio.Application.prototype.get_dbus_connection

function get_dbus_connection(): Gio.DBusConnection {
    // Gjs wrapper for g_application_get_dbus_connection()
}
  

Gets the Gio.DBusConnection being used by the application, or null.

If Gio.Application is using its D-Bus backend then this function will return the Gio.DBusConnection being used for uniqueness and communication with the desktop environment and other instances of the application.

If Gio.Application is not using D-Bus then this function will return null. This includes the situation where the D-Bus backend would normally be in use but we were unable to connect to the bus.

This function must not be called before the application has been registered. See Gio.Application.prototype.get_is_registered.

Since 2.34

Returns

a Gio.DBusConnection, or null