File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,22 @@ const WORKSPACE_KEY = 'org.gnome.shell.extensions.paperwm.workspace';
12
12
export class WorkspaceSettings {
13
13
constructor ( extension ) {
14
14
this . workspaceSettingsCache = { } ;
15
- this . schemaSource = Gio . SettingsSchemaSource . new_from_directory (
16
- GLib . build_filenamev ( [ extension . path , "schemas" ] ) ,
17
- Gio . SettingsSchemaSource . get_default ( ) ,
18
- false
19
- ) ;
15
+
16
+ console . debug ( "Extension path " + extension . dir . get_parent ( ) . get_path ( ) ) ;
17
+ console . debug ( "XDG_DATA_DIR=" + GLib . get_user_data_dir ( ) ) ;
18
+ if ( extension . dir . get_parent ( ) . get_path ( ) == GLib . get_user_data_dir ( ) ) {
19
+ console . debug ( "We are installed in $XDG_DATA_HOME" ) ;
20
+ this . schemaSource = Gio . SettingsSchemaSource . new_from_directory (
21
+ GLib . build_filenamev ( [ extension . path , "schemas" ] ) ,
22
+ Gio . SettingsSchemaSource . get_default ( ) ,
23
+ false
24
+ ) ;
25
+ } else {
26
+ // assume we are installed system-wide and our schema source is in
27
+ // the default schema.
28
+ console . debug ( "We are installed in system $PREFIX." ) ;
29
+ this . schemaSource = Gio . SettingsSchemaSource . get_default ( ) ;
30
+ }
20
31
21
32
this . workspaceList = new Gio . Settings ( {
22
33
settings_schema : this . getSchemaSource ( ) . lookup ( WORKSPACE_LIST_KEY , true ) ,
You can’t perform that action at this time.
0 commit comments