forked from johnnyg/gnome-shell-extensions-coverflowalttab
-
Notifications
You must be signed in to change notification settings - Fork 1
/
extension.js
43 lines (34 loc) · 1.6 KB
/
extension.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Gnome-shell extension specific routines.
*
* register/unregister keybinding handlers, etc.
*/
const Lang = imports.lang;
const Main = imports.ui.main;
const Meta = imports.gi.Meta;
const CoverflowAltTab = imports.misc.extensionUtils.getCurrentExtension();
const Manager = CoverflowAltTab.imports.manager;
let manager = null;
function init() {
}
function enable() {
if (!manager) {
manager = new Manager.Manager();
}
Meta.keybindings_set_custom_handler('switch-windows', Lang.bind(manager, manager._startWindowSwitcher));
Meta.keybindings_set_custom_handler('switch-group', Lang.bind(manager, manager._startWindowSwitcher));
Meta.keybindings_set_custom_handler('switch-panels', Lang.bind(manager, manager._startWindowSwitcher));
Meta.keybindings_set_custom_handler('switch-windows-backward', Lang.bind(manager, manager._startWindowSwitcher));
Meta.keybindings_set_custom_handler('switch-group-backward', Lang.bind(manager, manager._startWindowSwitcher));
}
function disable() {
if (manager) {
manager = null;
}
Meta.keybindings_set_custom_handler('switch-windows', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-group', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-panels', Lang.bind(Main.wm, Main.wm._startA11ySwitcher));
Meta.keybindings_set_custom_handler('switch-windows-backward', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
Meta.keybindings_set_custom_handler('switch-group-backward', Lang.bind(Main.wm, Main.wm._startAppSwitcher));
}