-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
extension.js
45 lines (37 loc) · 2.32 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
44
45
//////////////////////////////////////////////////////////////////////////////////////////
// ___ _ ___ //
// | | \/ | ) | | //
// O- |- | | - | | |- -O //
// | |_ | | | |_ //
// //
//////////////////////////////////////////////////////////////////////////////////////////
// SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
// SPDX-License-Identifier: MIT
'use strict';
import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js';
import Daemon from './src/extension/Daemon.js';
//////////////////////////////////////////////////////////////////////////////////////////
// Once enabled, Fly-Pie creates an instance of the Daemon class. This daemon will //
// show a pie menu when it receives a show-menu request on the D-Bus or when one of //
// the configured shortcuts are pressed. //
// //
// This extension consists of three main source code directories: //
// daemon/ This contains code which is only required by extension.js. //
// settings/ This contains code which is only required by prefs.js. //
// common/ This contains code which is required by extension.js and prefs.js. //
//////////////////////////////////////////////////////////////////////////////////////////
export default class FlyPie extends Extension {
// This function could be called after the extension is enabled, which could be done
// from GNOME Tweaks, when you log in or when the screen is unlocked. We create an
// instance of the Daemon class.
enable() {
this.daemon = new Daemon(this.metadata);
}
// This function could be called after the extension is uninstalled, disabled in GNOME
// Tweaks, when you log out or when the screen locks. It deletes the previously created
// damon.
disable() {
this.daemon.destroy();
this.daemon = null;
}
}