Invoking `app.open_new_window` on gnome-terminal does not inherit $PWD. We want
that so take matter into our own hands.
Note: vte.sh must be sourced in the terminal's shell.
Other approaches:
Write a custom .desktop file where "Exec" is a custom script (Note that it's
probably not possible to call the dbus action using dbus-send or qdbus due to
the argument structure)
I tried to use the dbus interface directly from js too, but it seems basically
impossible to call correctly..
const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
Gio.DBus.session.call(
metaWindow.gtk_unique_bus_name,
metaWindow.gtk_window_object_path,
"org.gtk.Actions",
"Activate",
GLib.Variant.new_tuple([
new GLib.Variant("s", "new-terminal"),
GLib.Variant.new_array(null,
[new GLib.Variant('(ss)', ["window", "current"])]),
GLib.Variant.new_array(new GLib.VariantType("{sv}"), [])
]),
null, Gio.DBusCallFlags.NONE, -1, null,
(conn, result) => {}
);
Complains about wrong type - wants the first array to be "av", not "a(ss)", but
I don't know how to create a "opaque" variant..
Keywords: current directory
We're assessing all top level declarations from outside the original scope when
we're evaluating code. So everything should be `var`.
Classes are `let` bound so we should use var for `ClickOverlay` too, but there's
a bug in gnome-shell-mode making such statements not evaluate. We therefor wait
for that to be fixed.