1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 06:59:45 +01:00

gtk: use dconf module for settings

This commit is contained in:
Robert Helgesson 2018-11-04 21:10:40 +01:00
parent a0162dacf6
commit 4104ff2b6a
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -8,8 +8,6 @@ let
cfg2 = config.gtk.gtk2;
cfg3 = config.gtk.gtk3;
dag = config.lib.dag;
toGtk3Ini = generators.toINI {
mkKeyValue = key: value:
let
@ -29,16 +27,6 @@ let
in
"${n} = ${v'}";
toDconfIni = generators.toINI {
mkKeyValue = key: value:
let
tweakVal = v:
if isString v then "'${v}'"
else toString v;
in
"${key}=${tweakVal value}";
};
fontType = types.submodule {
options = {
package = mkOption {
@ -216,21 +204,8 @@ in
xdg.configFile."gtk-3.0/gtk.css".text = cfg3.extraCss;
home.activation = mkIf cfg3.waylandSupport {
gtk3 = dag.entryAfter ["installPackages"] (
let
iniText = toDconfIni { "/" = dconfIni; };
iniFile = pkgs.writeText "gtk3.ini" iniText;
dconfPath = "/org/gnome/desktop/interface/";
in
''
if [[ -v DRY_RUN ]]; then
echo ${pkgs.gnome3.dconf}/bin/dconf load ${dconfPath} "<" ${iniFile}
else
${pkgs.gnome3.dconf}/bin/dconf load ${dconfPath} < ${iniFile}
fi
''
);
dconf.settings = mkIf cfg3.waylandSupport {
"org/gnome/desktop/interface" = dconfIni;
};
}
);