I'm using Gnome on a tablet as a daily driver. The integrated virtual keyboard doesn't serve as a replacement for a real keyboard, but I need exactly that. Thus I want to replace it with Onboard, and started to write an extension for Gnome Shell. The goal is to hide and show Onboard when the integrated virtual keyboard would be hidden/shown.
I can show/hide Onboard through DBus like this:
dbus-send --type=method_call --dest=org.onboard.Onboard /org/onboard/Onboard/Keyboard org.onboard.Onboard.Keyboard.Show
I adapted the example at https://wiki.gnome.org/Gjs/Examples/DBusClient to test showing/hiding Onboard through DBus:
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
// This the D-Bus interface as XML
const OnboardInterface = '<node> \
<interface name="org.onboard.Onboard.Keyboard"> \
<method name="ToggleVisible"> \
</method> \
<method name="Show"> \
</method> \
<method name="Hide"> \
</method> \
</interface> \
</node>';
// Declare the proxy class based on the interface
const OnboardProxy = Gio.DBusProxy.makeProxyWrapper(OnboardInterface);
let OnbProxy = new OnboardProxy(
Gio.DBus.system,
"org.onboard.Onboard",
"/org/onboard/Onboard/Keyboard"
);
OnbProxy.ShowSync()
let loop = new GLib.MainLoop(null, false);
loop.run();
Sadly it doesn't show Onboard, instead throws this error:
$ gjs ./test.js
(gjs:13144): Gjs-WARNING **: JS ERROR: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.onboard.Onboard was not provided by any .service files
_proxyInvoker@resource:///org/gnome/gjs/modules/overrides/Gio.js:98
_makeProxyMethod/<@resource:///org/gnome/gjs/modules/overrides/Gio.js:124
@./test.js:26
JS_EvaluateScript() failed
I have no clue why it talks about services when all I wan't to do is sending a message trough DBus? It's probably a rather stupid mistake as I don't have any experience with either Gnome Shell extensions nor DBus..
Version of Gnome is 3.18.0