From 3773095069a7170e14c339825565f2a70b0009b2 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Thu, 10 Oct 2024 00:21:05 +0200 Subject: [PATCH] home/programs/gtk: use color-scheme for gtk4.0 --- home/programs/gtk.nix | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/home/programs/gtk.nix b/home/programs/gtk.nix index ac4ad27..6aed1a9 100644 --- a/home/programs/gtk.nix +++ b/home/programs/gtk.nix @@ -4,20 +4,16 @@ config, nixosConfig, ... -}: { +}: let + isDark = inputs.basix.schemeData.base16.${nixosConfig.style.scheme}.variant == "dark"; +in { home.pointerCursor = { inherit (nixosConfig.style.cursorTheme) name package size; gtk.enable = true; x11.enable = true; }; - gtk = let - isDark = inputs.basix.schemeData.base16.${nixosConfig.style.scheme}.variant == "dark"; - commonGtkConfig = { - gtk-decoration-layout = ":menu"; - gtk-application-prefer-dark-theme = isDark; - }; - in { + gtk = { enable = true; font = { @@ -26,8 +22,14 @@ size = 11; }; - gtk3.extraConfig = commonGtkConfig; - gtk4.extraConfig = commonGtkConfig; + gtk3.extraConfig = { + gtk-decoration-layout = ":menu"; + gtk-application-prefer-dark-theme = isDark; + }; + + gtk4.extraConfig = { + gtk-decoration-layout = ":menu"; + }; gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; @@ -39,4 +41,12 @@ inherit (nixosConfig.style.gtk.theme) name package; }; }; + dconf.settings = { + "org/gnome/desktop/interface" = { + color-scheme = + if isDark + then "prefer-dark" + else "default"; + }; + }; }