If I have a bus name, an object path, and an interface, how do I call DBus methods from Gjs (in the gnome-shell extension)?
I am looking for the equivalent of the following python code:
import dbus
bus = dbus.SessionBus()
obj = bus.get_object("org.gnome.Caribou.Keyboard", "/org/gnome/SessionManager/EndSessionDialog")
obj.Open(0, 0, 120, dbus.Array(signature="o"))
(Note that I didn’t explicitly use the interface due to some python-dbus magic, but I could have iface = dbus.interface(obj, "org.gnome.SessionManager.EndSessionDialog"). Since I have the interface name, I am fine with the solution that requests it. Note that this example would be stupid in Gjs as it refers to gnome-shell)
source
share