forked from bsaleil/todolist-gnome-shell-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.js
29 lines (23 loc) · 769 Bytes
/
utils.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
// Authors:
// * Baptiste Saleil http://bsaleil.org/
// * Community: https://github.com/bsaleil/todolist-gnome-shell-extension/network
// With code from: https://github.com/vibou/vibou.gTile
//
// Licence: GPLv2+
const Gio = imports.gi.Gio;
const Extension = imports.misc.extensionUtils.getCurrentExtension();
function getSettings()
{
let dir = Extension.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.todolist', false);
if(!schema)
throw new Error('Schema missing.');
return new Gio.Settings({
settings_schema: schema
});
}