-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextension.js
43 lines (37 loc) · 1.67 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
'use strict'
// This is a handy import we'll use to grab our extension's object
const ExtensionUtils = imports.misc.extensionUtils;
const Extension = ExtensionUtils.getCurrentExtension();
const ListenerDbusServer = Extension.imports.lib.listenerDbusServer.ListenerDbusServer
const Dashboard = Extension.imports.lib.dashboard.Dashboard
class ScreensaverDashboard {
constructor() {
this.listenerDbusServer = new ListenerDbusServer()
this.dashboard = new Dashboard()
}
// This function could be called after your extension is enabled, which could
// be done from GNOME Tweaks, when you log in or when the screen is unlocked.
//
// This is when you setup any UI for your extension, change existing widgets,
// connect signals or modify GNOME Shell's behaviour.
enable() {
log(`enabling ${Extension.metadata.name} version ${Extension.metadata.version}`);
}
// This function could be called after your extension is uninstalled, disabled
// in GNOME Tweaks, when you log out or when the screen locks.
//
// Anything you created, modifed or setup in enable() MUST be undone here. Not
// doing so is the most common reason extensions are rejected during review!
disable() {
log(`disabling ${Extension.metadata.name} version ${Extension.metadata.version}`);
}
}
// This function is called once when your extension is loaded, not enabled. This
// is a good time to setup translations or anything else you only do once.
//
// You MUST NOT make any changes to GNOME Shell, connect any signals or add any
// MainLoop sources here.
function init() {
log(`initializing ${Extension.metadata.name} version ${Extension.metadata.version}`);
return new ScreensaverDashboard()
}