forked from passingthru67/workspaces-to-dock
/
extension.js
executable file
·44 lines (35 loc) · 1.31 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
/* ========================================================================================================
* extension.js - gnome shell extension
* --------------------------------------------------------------------------------------------------------
* CREDITS: This code was copied from the dash-to-dock extension https://github.com/micheleg/dash-to-dock
* and modified to create a workspaces dock. Many thanks to michele_g for a great extension.
* ========================================================================================================
*/
const Me = imports.misc.extensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
const Intellihide = Me.imports.intellihide;
const DockedWorkspaces = Me.imports.dockedWorkspaces;
let settings;
let intellihide;
let dock;
function init() {
}
function show() {
dock.disableAutoHide();
}
function hide() {
dock.enableAutoHide();
}
function enable() {
settings = Convenience.getSettings('org.gnome.shell.extensions.workspaces-to-dock');
dock = new DockedWorkspaces.dockedWorkspaces(settings);
intellihide = new Intellihide.intellihide(show, hide, dock, settings);
}
function disable() {
intellihide.destroy();
dock.destroy();
settings.run_dispose();
dock = null;
intellihide = null;
settings = null;
}