summaryrefslogtreecommitdiff
path: root/toggle-workspace@jodersky.github.com/util.js
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2015-04-26 15:44:16 +0200
committerJakob Odersky <jodersky@gmail.com>2015-04-26 15:47:29 +0200
commit7df7eaeb8ea308751757775ec249b9f84da249d6 (patch)
tree316d0a8f052d3896309381c7d01e4c126e5eeaa5 /toggle-workspace@jodersky.github.com/util.js
downloadtoggle-workspace-7df7eaeb8ea308751757775ec249b9f84da249d6.tar.gz
toggle-workspace-7df7eaeb8ea308751757775ec249b9f84da249d6.tar.bz2
toggle-workspace-7df7eaeb8ea308751757775ec249b9f84da249d6.zip
initial commit
Diffstat (limited to 'toggle-workspace@jodersky.github.com/util.js')
-rw-r--r--toggle-workspace@jodersky.github.com/util.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/toggle-workspace@jodersky.github.com/util.js b/toggle-workspace@jodersky.github.com/util.js
new file mode 100644
index 0000000..a604bff
--- /dev/null
+++ b/toggle-workspace@jodersky.github.com/util.js
@@ -0,0 +1,22 @@
+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.toggle-workspace', false);
+
+ if(!schema) {
+ throw new Error('Schema missing.');
+ }
+
+ return new Gio.Settings({
+ settings_schema: schema
+ });
+} \ No newline at end of file