From 5aea7fab2708186baaf6e3f6d757ae42b6be1f99 Mon Sep 17 00:00:00 2001 From: rope Date: Mon, 3 Aug 2026 10:18:09 +0100 Subject: [PATCH] gtk: tint surfaces off base00 like the shell, not stylix's off-hue base01 Co-Authored-By: Claude Opus 5 --- settings/desktop.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/settings/desktop.nix b/settings/desktop.nix index 887d3ed..c9be1e8 100644 --- a/settings/desktop.nix +++ b/settings/desktop.nix @@ -71,7 +71,15 @@ programs.xwayland.enable = true; programs.dconf.enable = true; - home-manager.users.fred = { config, lib, pkgs, ... }: { + home-manager.users.fred = { config, lib, pkgs, ... }: let + # Scaling all three channels by the same factor is exactly what + # Qt.lighter() does — hue and HSV saturation stay put, only value moves — + # so this lands on the same surfaces as quickshell's Theme.base01/base02. + # GTK's own shade() can't stand in: it multiplies saturation too. + tint = f: let + ch = k: toString (builtins.floor (builtins.fromJSON config.lib.stylix.colors."base00-rgb-${k}" * f)); + in "rgb(${ch "r"}, ${ch "g"}, ${ch "b"})"; + in { # Stylix's qt target only supports qtct; disable it to silence the warning. stylix.targets.qt.enable = false; # Minimal titlebars — stylix manages the GTK theme; we layer our @@ -89,6 +97,18 @@ gtk.gtk3.extraConfig.gtk-application-prefer-dark-theme = true; stylix.targets.gtk.extraCss = '' + /* Surfaces: one hue, three steps — the same ladder quickshell's Theme + uses (settings/quickshell.nix, commit e2c413d). Stylix paints every + raised surface with base01/base02, which come straight off the + wallpaper and routinely land off-hue: base01 is #3f3fab purple over a + slate #1c1f26 desktop, which is why nemo's delete dialog was blue. */ + @define-color headerbar_bg_color ${tint 1.7}; + @define-color sidebar_bg_color ${tint 1.7}; + @define-color card_bg_color ${tint 1.7}; + @define-color dialog_bg_color ${tint 1.7}; + @define-color popover_bg_color ${tint 1.7}; + @define-color scrollbar_outline_color ${tint 2.4}; + headerbar { min-height: 0; padding: 0; margin: 0; } headerbar .title { font-size: 0; } window:backdrop {