forked from gTile/gTile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.js
More file actions
33 lines (26 loc) · 720 Bytes
/
Copy pathsettings.js
File metadata and controls
33 lines (26 loc) · 720 Bytes
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
'use strict'
// Library imports
const Gio = imports.gi.Gio;
// Extension imports
const Me = imports.misc.extensionUtils.getCurrentExtension();
var settings;
function get() {
if (!settings) {
let dir = Me.dir.get_child('schemas').get_path();
let source = Gio.SettingsSchemaSource.new_from_directory(
dir,
Gio.SettingsSchemaSource.get_default(),
false);
if (!source) {
throw new Error('Error Initializing the thingy.');
}
let schema = source.lookup('org.gnome.shell.extensions.gtile', false);
if (!schema) {
throw new Error('Schema missing.');
}
settings = new Gio.Settings({
settings_schema: schema
});
}
return settings;
}