1 Gnome-tweaks does not look at GSETTINGS_SCHEMA_PATH or XDG_DATA_DIRS, it
2 assumes that schemas are installed in one global directory
3 (GSETTINGS_SCHEMA_DIR/gsettingsschemadir).
5 Guix/GuixSD uses a different directory for every gir package and has
6 packages pick-up files using XDG_DATA_DIRS.
8 Upstream ticket: https://bugzilla.gnome.org/show_bug.cgi?id=764537
11 --- gnome-tweak-3.18.1.orig/gtweak/gsettings.py 2015-04-08 15:21:32.000000000 +0200
12 +++ gnome-tweak-tool-3.18.1/gtweak/gsettings.py 2016-04-03 11:26:38.658482704 +0200
14 # along with gnome-tweak-tool. If not, see <http://www.gnu.org/licenses/>.
20 import xml.dom.minidom
24 class GSettingsMissingError(Exception):
27 +def file_from_path(path, file_name):
29 + f = os.path.join(dir, file_name)
30 + if os.path.exists(f):
34 class _GSettingsSchema:
35 def __init__(self, schema_name, schema_dir=None, schema_filename=None, **options):
38 if not schema_filename:
39 schema_filename = schema_name + ".gschema.xml"
41 + schema_prefix = os.path.join('glib-2.0', 'schemas')
42 schema_path = os.path.join(schema_dir, schema_filename)
43 if not os.path.exists(schema_path):
44 - logging.critical("Could not find schema %s" % schema_path)
45 + schema_path = file_from_path(os.environ.get ('GSETTINGS_SCHEMA_PATH', '').split(os.path.pathsep), schema_filename)
46 + if not (schema_path and os.path.exists(schema_path)):
47 + schema_path = file_from_path(os.environ.get ('XDG_DATA_DIRS', '').split(os.path.pathsep), os.path.join(schema_prefix, schema_filename))
48 + if not (schema_path and os.path.exists(schema_path)):
49 + logging.critical("Could not find schema %s" % schema_filename)
52 self._schema_name = schema_name