GNOME: Difference between revisions

Pigs (talk | contribs)
Tips and tricks: add back Excluding Gnome Applications section, under tips and tricks with a more minimal definition
Normalcea (talk | contribs)
dconf: Move explanation below given example.
Line 43: Line 43:
For example, the setting which controls the accent color of GNOME shell is located in the ''schema'' labeled <code>/org/gnome/desktop/interface/</code> which contains the ''key'' <code>accent-color</code> which accepts a GVariant ''value'' of type <code>enum</code> (one of <code>'blue'</code>, <code>'teal'</code>, <code>'green'</code>, etc)
For example, the setting which controls the accent color of GNOME shell is located in the ''schema'' labeled <code>/org/gnome/desktop/interface/</code> which contains the ''key'' <code>accent-color</code> which accepts a GVariant ''value'' of type <code>enum</code> (one of <code>'blue'</code>, <code>'teal'</code>, <code>'green'</code>, etc)


NixOS and Home Manager both provide an interface for declarative configuration of dconf settings exposed in <code>programs.dconf</code> and <code>dconf</code> modules respectively. This option accepts an attribute set whose names are schemas whose paired value is another attribute set whose names are keys and paired values as GVariant values.
NixOS and Home Manager both provide an interface for declarative configuration of dconf settings exposed in <code>programs.dconf</code> and <code>dconf</code> modules respectively.


Going back to the previous example, to set the accent color of GNOME in a declarative manner in NixOS as well as mapping the keyboard's "caps lock" key to "ctrl" you would write:
Going back to the previous example, to set the accent color of GNOME in a declarative manner in NixOS as well as mapping the keyboard's "caps lock" key to "ctrl" you would write:
Line 75: Line 75:
     };
     };
   };
   };
}|name=~/.config/home-manager/home.nix|lang=nix}}
}|name=~/.config/home-manager/home.nix|lang=nix}}Thus the settings attribute accepts an attribute set whose keys are schemas with each schema's value being a nested attribute set of the schema's keys with their appropriate GVariant value.{{Note|Schemas in Nix are written without leading and trailing slashes. In addition, since dconf have more data types than the Nix language (for example, tuples), in some cases you'll need to convert Nix value to a GVariant value. You can achieve that by using function defined in <code>lib.gvariant</code>, they're documented [https://nixos.org/manual/nixpkgs/stable/#sec-functions-library-gvariant here].}}
 
{{Note|Schemas in Nix are written without leading and trailing slashes. In addition, since dconf have more data types than the Nix language (for example, tuples), in some cases you'll need to convert Nix value to a GVariant value. You can achieve that by using function defined in <code>lib.gvariant</code>, they're documented [https://nixos.org/manual/nixpkgs/stable/#sec-functions-library-gvariant here].}}


==== Extensions ====
==== Extensions ====