From f103d343b012a5c002f7110302c62b1d2c6f0931 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Sun, 18 Dec 2022 16:10:24 +0100 Subject: gtk: add gtk3 theme --- usecases/desktop/graphical/gtk.nix | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'usecases/desktop/graphical/gtk.nix') diff --git a/usecases/desktop/graphical/gtk.nix b/usecases/desktop/graphical/gtk.nix index 4a9f501..0151492 100644 --- a/usecases/desktop/graphical/gtk.nix +++ b/usecases/desktop/graphical/gtk.nix @@ -4,6 +4,32 @@ inputs: { pkgs, ... }: let + gtk3Colors = ./gtk-colors.scss; + + gtk3CssFile = + pkgs.stdenv.mkDerivation ({ + name = "gtk3.css"; + + src = pkgs.gtk3.src; + + nativeBuildInputs = with pkgs; [sassc]; + + patchPhase = '' + cp -f ${gtk3Colors} gtk/theme/Adwaita/_colors.scss + substituteAllInPlace gtk/theme/Adwaita/_colors.scss + ''; + + dontConfigure = true; + dontInstall = true; + + buildPhase = '' + sassc -a -M -t expanded gtk/theme/Adwaita/gtk-contained-dark.scss $out + # These lines contains includes of assets + sed -i -e '/-gtk-icon/d' $out; + ''; + } + // config.theme.colors); + gtk4NamedColors = with config.theme.colors; { # From the main CSS # ----------------- @@ -94,7 +120,7 @@ in { }; xdg.configFile = { - # "gtk-3.0/gtk.css".source = gtkCssFile; + "gtk-3.0/gtk.css".source = gtk3CssFile; "gtk-4.0/gtk.css".source = gtk4CssFile; }; }; -- cgit v1.2.3