From 7ec50b1f77e62c79f07ed200853c07894195f544 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Tue, 21 Dec 2021 13:16:52 +0100 Subject: [PATCH] gtk: add support for GTK4 configuration --- modules/misc/gtk.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/misc/gtk.nix b/modules/misc/gtk.nix index 0b5a54d5..69ff34b2 100644 --- a/modules/misc/gtk.nix +++ b/modules/misc/gtk.nix @@ -7,6 +7,7 @@ let cfg = config.gtk; cfg2 = config.gtk.gtk2; cfg3 = config.gtk.gtk3; + cfg4 = config.gtk.gtk4; toGtk3Ini = generators.toINI { mkKeyValue = key: value: @@ -136,6 +137,21 @@ in { ''; }; }; + + gtk4 = { + extraConfig = mkOption { + type = with types; attrsOf (either bool (either int str)); + default = { }; + example = { + gtk-cursor-blink = false; + gtk-recent-files-limit = 20; + }; + description = '' + Extra configuration options to add to + $XDG_CONFIG_HOME/gtk-4.0/settings.ini. + ''; + }; + }; }; }; @@ -181,6 +197,9 @@ in { text = concatMapStrings (l: l + "\n") cfg3.bookmarks; }; + xdg.configFile."gtk-4.0/settings.ini".text = + toGtk3Ini { Settings = ini // cfg4.extraConfig; }; + dconf.settings."org/gnome/desktop/interface" = dconfIni; }); }