-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension.js
53 lines (43 loc) · 1.44 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
46
47
48
49
50
51
52
53
'use strict';
const Gio = imports.gi.Gio;
const St = imports.gi.St;
const unlock = imports.ui.unlockDialog;
const Main = imports.ui.main;
const background = imports.ui.background;
const init_opacity = background.ANIMATION_OPACITY_STEP_INCREMENT
const init_wakeup = background.ANIMATION_MIN_WAKEUP_INTERVAL
const ExtensionUtils = imports.misc.extensionUtils;
let settings = null;
class Extension{
constructor(){
}
enable(){
settings = ExtensionUtils.getSettings('org.gnome.shell.extensions.speedbackground');
background.ANIMATION_OPACITY_STEP_INCREMENT = OPACITY_STEP.get();
background.ANIMATION_MIN_WAKEUP_INTERVAL = WAKEUP_INTERVAL.get();
}
disable(){
settings = null;
background.ANIMATION_OPACITY_STEP_INCREMENT = init_opacity;
background.ANIMATION_MIN_WAKEUP_INTERVAL = init_wakeup;
// this extension uses both user and unlock-dialog session modes
// this is done so that the higher refresh rate is retained in the lock-settings
// without this, there would be a very jarring transition when locking, a high frame rate background will suddenly drop, causing it to skip frames and look quite ugly
}
}
function init() {
return new Extension();
}
//get from schemas
this.OPACITY_STEP = {
key: 'opacity-step',
get: function () {
return settings.get_double(this.key);
}
};
this.WAKEUP_INTERVAL = {
key: 'wakeup-interval',
get: function () {
return settings.get_double(this.key);
}
};