1 // vi: et sw=2 fileencoding=utf8
4 const Gio = imports.gi.Gio;
5 const GLib = imports.gi.GLib;
7 function getSettings(ext) {
8 let schemaName = "org.gnome.shell.extensions.AdvancedVolumeMixer";
9 let schemaDir = ext.dir.get_child("schemas").get_path();
11 if (GLib.file_test(schemaDir + '/gschemas.compiled', GLib.FileTest.EXISTS)) {
12 let schemaSource = Gio.SettingsSchemaSource.new_from_directory(
14 Gio.SettingsSchemaSource.get_default(),
17 let schema = schemaSource.lookup(schemaName, false);
19 return new Gio.Settings({
20 settings_schema: schema
23 if (Gio.Settings.list_schemas().indexOf(schemaName) == -1) {
24 throw "Schema \"%s\" not found.".format(schemaName);
27 return new Gio.Settings({ schema: schemaName });