gsettings-schema-convert
Convert GSettings schemas to binary format
SYNOPSIS
gsettings-schema-convert [OPTION...]
PARAMETERS
-i, --input=FILE
Reads the input schema from FILE instead of standard input. This is typically the deprecated keyfile format schema.
-o, --output=FILE
Writes the converted schema to FILE instead of standard output. The output will be in the XML format.
-d, --doctype
Includes the XML DOCTYPE declaration in the output. This can be useful for XML validation.
-h, --help
Displays a help message and exits.
-v, --version
Displays version information and exits.
DESCRIPTION
gsettings-schema-convert is a utility designed to facilitate the migration and interoperability of GSettings schemas by converting them between different formats. Primarily, its role is to convert deprecated keyfile-based GSettings schemas (a simple INI-like format) into the modern XML format used by GSettings.
GSettings is the configuration storage system used by the GNOME desktop environment and many GTK applications. Schemas define the structure, types, default values, and descriptions of settings. The transition from keyfile to XML schemas was a significant update in GLib's configuration management, offering better structure, validation, and internationalization capabilities. This command helps developers and system administrators update legacy schemas to the current standard, ensuring compatibility and leveraging the benefits of the XML format.
CAVEATS
This utility is primarily focused on converting from the older, deprecated keyfile schema format to the newer XML format. While it aids in migration, it may not perfectly handle all edge cases or very complex schema definitions. The converted XML output should always be reviewed for correctness and then compiled using glib-compile-schemas for GSettings to use it.
SCHEMA FORMATS
GSettings schemas can exist in two primary formats:
1. Keyfile Format: An older, deprecated INI-like format (e.g., .gschema.override files or older .gschema.keyfile). It's simpler but lacks XML's structured benefits.
2. XML Format: The modern, preferred format (e.g., .gschema.xml files). It offers better structure, support for multiple translations, complex types, and validation rules. gsettings-schema-convert primarily converts from the keyfile format to the XML format.
TYPICAL WORKFLOW
A common workflow for creating or updating GSettings schemas involves:
1. Defining settings in an XML schema file (.gschema.xml).
2. If migrating from an old keyfile, using gsettings-schema-convert to convert it to XML.
3. Compiling the XML schema into a binary database using glib-compile-schemas.
4. Placing the compiled schema in the appropriate system or user directory for GSettings to find and use.
HISTORY
gsettings-schema-convert is part of the GLib library, specifically the GSettings framework. Its existence is tied to the evolution of configuration management within the GNOME project and related GTK applications. It emerged as a tool to smooth the transition from older GConf-based systems and, more directly, from the initial keyfile-based GSettings schemas to the more robust and standardized XML format. This reflects GLib's commitment to improving developer experience and application configuration capabilities over time.
SEE ALSO
gsettings(1), glib-compile-schemas(1), gio(1)