Commit Graph

4 Commits

Author SHA1 Message Date
Tor Hedin Brønner
5b491d77a9 app: Look up custom window handlers in a dict
This makes it easier to add new handlers in `user.js`.
2018-06-15 10:19:29 +02:00
Ole Jørgen Brønner
33a365f326 Handle gnome-terminal specially in newWindow
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
2018-05-21 14:32:06 +02:00
Tor Hedin Brønner
42aedba3b6 Use var for all top level declarations to avoid warnings
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.
2018-04-30 00:03:08 +02:00
Tor Hedin Brønner
56708fee15 Super+n: Global new window binding
Add a new window action, bound to Super+n by default. This clashes with the
`focus-active-notification` so we kill it.

Schema change!
2018-01-10 10:00:03 +01:00