Skip to content

Tuner.Setting

The main binding: connects a widget to a GSettings key. The sync is two-way — changing the widget writes the key, changing the key (e.g. from a terminal) updates the widget.

PropertyTypeDescription
schema-idstringGSettings schema id
schema-keystringKey inside the schema
transformSettingTransformOptional value transform
validatorValidatorReaction to a missing schema, see below
blp
Tuner.Switch {
    title: _("Over Amplification");

    binding: Tuner.Setting {
        schema-id: "org.gnome.desktop.sound";
        schema-key: "allow-volume-above-100-percent";
    };
}

A reset button appears next to the row automatically when the key value differs from the schema default.

Missing schemas and validation

If the schema or key does not exist on the user's system, the binding stays silently inactive: the row is shown, but does nothing. Add Tuner.SimpleValidator to handle this case:

blp
binding: Tuner.Setting {
    schema-id: "org.gnome.shell.extensions.example";
    schema-key: "enabled";

    validator: Tuner.SimpleValidator {
        method: visibility;
    };
};

method is one of:

  • sensitivity — the row is greyed out when the schema is missing (default);
  • visibility — the row is hidden.

This is the recommended way to write plugins that work across distributions where some components may not be installed.

Released under the GPL-3.0+ License. The content is available under CC BY-SA 4.0, unless stated otherwise.