Commit Graph
113 Commits
Author SHA1 Message Date
Ole Jørgen Brønner 492dc9ec15 Misc cleanup 2019-01-05 14:22:46 +01:00
Tor Hedin Brønner d198a2a088 Don't use utils in extension.js
If utils fails to load we're not getting proper error messages as we're using it
outside a try block. Use `log` instead.

SyntaxErrors still doesn't return a proper trace unfortunately, though that's
perhaps better fixed in tooling. The alternative would be to run `Reflect.parse`
on the module file in the catch block returning that error instead...
2018-12-17 22:21:57 +01:00
Ole Jørgen Brønner 4b3e24d7ef Improve installConfig (remove annoying warning)
Don't display "Failed to install..." warning when a first-user already have a
user.js config

Still track has-installed-config-template so it's possible to remove the user
config dir without it reappearing on each extenstion init.
2018-12-08 15:45:05 +01:00
Tor Hedin Brønner 7f45a59673 init: also catch syntax errors in our own modules
Also add some high level descriptions of the various modules
2018-12-02 15:38:54 +01:00
Ole Jørgen Brønner d3bf076c2f Bugfix: paperwm crashed on gnome-shell < 3.30 due to uninitialized workspace_manager
utils.js imports tiling.js which cause tiling.js's local workspace_manager
reference to be set before it's pollyfilled

Regression after: 8c931438cd
2018-12-02 15:33:50 +01:00
Tor Hedin Brønner bea3dd88a9 init: don't bail if user.js has syntax errors
We need to wrap the initial evaluation of user.js too.
2018-12-01 05:02:46 +01:00
Tor Hedin Brønner 8c931438cd cleanup: let -> var, remove global PaperWM
Such globals are better to have in user.js
2018-11-27 14:23:02 +01:00
Tor Hedin Brønner 877726a2a2 Move keybind init to keybindings.js 2018-11-27 14:23:02 +01:00
Tor Hedin Brønner e701bd48f0 extension: wrap all init/enable/disable in try blocks 2018-11-27 14:23:02 +01:00
Ole Jørgen Brønner 62761ec4cc Respect XDG_CONFIG_HOME (user.js)
Fixes #78
2018-09-05 09:26:16 +02:00
Tor Hedin Brønner 124d752a1e Add 3 finger touchpad navigation on wayland
The code isn't all that pretty, but it's easy to modify and tune to test what
works well.

I've opted to keep the workspace menu's smooth scroll implementation. When
swiping it's necessary to wait for a button press on the desired space since the
pointer can be anywhere. As such making sure that the workspace stack always
ends up in a discrete state isn't that useful, so I opted for more control when
swiping.

We should add some preferences that users can use to tune the speed of swiping.
I assume that this can vary quite a lot between different touchpads.
2018-08-28 01:35:31 +02:00
Tor Hedin Brønner 145a8d3347 Polyfill global.workspace_manager 2018-08-27 20:33:34 +02:00
Tor Hedin Brønner 07ab295d28 Add move functionality to spaces.selectSpace 2018-07-18 23:08:23 +02:00
Tor Hedin Brønner 3b81029533 Simple fix for the minimap 2018-07-18 22:37:34 +02:00
Tor Hedin Brønner 0ed2cd32bf Refactor workspace selection from navigator to spaces
This is a bit cleaner, and makes it possible to deal with previous-workspace
etc. the same way as switch-next etc. ie. mostly handled through it's action
handler, instead of special casing in navigator.js.

Another benefit is that we now actually keep track of the workspace mru
directly, eg. empty workspaces doesn't just drop off for no reason.
2018-07-18 22:37:34 +02:00
Ole Jørgen Brønner a64860bb47 Remove utils.as_key_handler 2018-07-18 22:37:34 +02:00
Ole Jørgen Brønner 39e0a68d3c Refactor switch-next/previous 2018-07-18 22:37:34 +02:00
Ole Jørgen Brønner 0b551114b3 Refactor move-left/right/up/down 2018-07-18 22:37:34 +02:00
Ole Jørgen Brønner 61290f142d Prepare for navigator refactor + refactor switch-left/right/up/down 2018-07-18 22:37:34 +02:00
Tor Hedin Brønner ca4c78779d Only hijack needed actions when needed
We listen on the relevant schemas and redo all hijacked keybindings.
2018-07-13 11:40:03 +02:00
Ole Jørgen Brønner e1bc0853a2 Disable and enable our keybindings more robustly 2018-07-06 12:16:37 +02:00
Ole Jørgen Brønner 71b6ee8f56 Unify regular keybinding api an schemaless keybinding api
Try to make it a bit more "action oriented":

  An action exists independently of its binding. It could conceivable be invoked
  by other means too.

Some weirdness from the marriage remain to weed out, but this is a working
stepping stone.
2018-07-06 12:16:37 +02:00
Ole Jørgen Brønner d3f2d07cf9 Move keybinding bookkeeping out of extension.js 2018-07-06 12:16:37 +02:00
Ole Jørgen Brønner 5bce8922c1 API for ad-hoc/schemaless/user keybindings 2018-07-06 12:16:37 +02:00
Tor Hedin Brønner 895b1915cd Add our own actions for all bindings
While we might need to steal some actions from gnome, we should support using
both actions if the user wants it.

Also add all the correct default bindings to the schema, and don't touch gesettings
at all. This should make it simpler to get #66 done.
2018-07-03 17:16:21 +02:00
Tor Hedin Brønner 4c9b7706bf Rename schema path to /org/gnome/shell/extensions/paperwm/
Also add /org/gnome/shell/extensions/paperwm/keybindings

NB! This is a breaking change to any existing config.
2018-07-03 17:01:57 +02:00
Tor Hedin Brønner 3548f219a2 Rename prefs.js to settings.js
prefs.js causes issues as its used to lauch the settings gui from eg. tweaks.
2018-07-02 22:31:55 +02:00
Tor Hedin Brønner f011c6e0e9 Cleanup and some comments 2018-06-27 11:28:23 +02:00
Tor Hedin Brønner db19ac1376 Simply keybindings somewhat
Only use one instance of the wrapped functions.
2018-06-25 16:50:44 +02:00
Tor Hedin Brønner d47e731aae Add slurp-[i]n/barf-[o]ut bindings
`<super>i` and `<super>o` as default bindings.
2018-06-25 16:50:44 +02:00
Tor Hedin Brønner 5306316929 Add column reordering 2018-06-25 16:50:44 +02:00
Tor Hedin Brønner 49e4596e24 Add spatial navigation with arrow keys 2018-06-25 16:50:44 +02:00
Ole Jørgen Brønner cca3038957 Center window function (with mouse warp)
I find myself centering the focus window quite often since it's more
comfortable looking straight ahead.
2018-06-21 22:21:26 +02:00
Tor Hedin Brønner 50158d6f91 <Super>Up/Down: bind to workspace mru stack
Also add <Super><Ctrl>Down/UP
2018-05-29 18:30:35 +02:00
Tor Hedin Brønner 2e23a8aa78 <Super>Home/End: activate first/last window 2018-05-29 14:22:35 +02:00
Tor Hedin Brønner 19695dfbfa disable: reset our own keybindings 2018-05-29 13:46:12 +02:00
Tor Hedin Brønner e48fef508f Restore restore-shortcuts binding 2018-05-27 21:30:25 +02:00
Ole Jørgen Brønner 39ddd6b4ca Restore built-in mutter keybindings on disable 2018-05-26 19:58:56 +02:00
Tor Hedin Brønner 6094bd46f8 Bind <Super>Up to toggleMaximizeHorizontally 2018-05-24 18:15:22 +02:00
Tor Hedin Brønner 7c70da6e66 Bind <Super>Right/Left to switch-next/previous
Don't think it's possible to rebind these keys on disable.
2018-05-24 17:52:59 +02:00
Ole Jørgen Brønner 1bc2075e84 Display notification on errors in user.js 2018-05-20 17:24:23 +02:00
Tor Hedin Brønner 6942df947f Monitor preference changes
Introduces `prefs.js` with simple `settings::change` signal handling.

Also put workspace colors in the schema and draw them from there.
2018-05-15 16:31:01 +02:00
Tor Hedin Brønner d23ae6f7ac Use custom handler for extra close methods
This avoids overriding the default close binding (alt-f4).
2018-05-14 15:22:57 +02:00
Tor Hedin Brønner 08ba7c89df bindings: Use a custom handler on restore-shortcuts
Haven't looked at restoration at disable, but this will at least restore things
on restart.

Also remove killKeybinding and restoreKeybindings as they worked out really
badly.
2018-05-11 15:45:19 +02:00
Tor Hedin Brønner 132f0a4b3f Always run native keybinding code on enable/disable
This should avoid reverting back to default keybinding in a buggy disable/enable
cycle.
2018-05-03 20:49:20 +02:00
Tor Hedin Brønner e909e17ab6 Make it possible for the user to override eg. the close keybinding
Run module.enable after keybind setup.
2018-05-02 10:47:42 +02:00
Ole Jørgen Brønner 3b18b3882f Load rc/user-config after full init and catch errors in enable/disable
Ref: #51
2018-05-01 17:20:56 +02:00
Ole Jørgen Brønner ba21e6859c Implement rcfile/user-config as module (#51)
Fixes #51
2018-05-01 17:07:05 +02:00
Tor Hedin Brønner 839527bcdb Always log init, enable and disable 2018-05-01 15:48:01 +02:00
Ole Jørgen Brønner e394767e6c Cosmetic: snake to camelCase 2018-05-01 13:56:04 +02:00