forked from bsaleil/todolist-gnome-shell-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.js
34 lines (28 loc) · 809 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
30
31
32
33
34
// This extension was developed by :
// * 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
});
}