From f7f8e531be5394eb8f2b5916bf95c0c6ea665772 Mon Sep 17 00:00:00 2001 From: ediblerope Date: Fri, 15 May 2026 22:38:02 +0100 Subject: [PATCH] --- settings/stylix.nix | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/settings/stylix.nix b/settings/stylix.nix index c5cfca8..f294916 100644 --- a/settings/stylix.nix +++ b/settings/stylix.nix @@ -79,20 +79,26 @@ (builtins.tail ranked)).name; # Papirus-Dark with folders recolored to the closest matching color. - # Built as a derivation so it lands in the nix store — no activation scripts. - papirusDark = pkgs.runCommand "papirus-dark-${closestPfColor}" { - nativeBuildInputs = [ pkgs.papirus-folders ]; - } '' - # Copy theme to a writable temp dir and pass its absolute path to - # papirus-folders so it bypasses XDG lookup entirely. - themedir=$(mktemp -d)/Papirus-Dark - cp -r ${pkgs.papirus-icon-theme}/share/icons/Papirus-Dark "$themedir" - chmod -R u+w "$themedir" + # Replicates papirus-folders' change_color logic directly: for each + # colored variant (folder-{color}-*.svg), symlink the generic name + # (folder-*.svg) to it. No papirus-folders binary needed. + papirusDark = pkgs.runCommand "papirus-dark-${closestPfColor}" {} '' + cp -r ${pkgs.papirus-icon-theme}/share/icons/Papirus-Dark $out + chmod -R u+w $out - papirus-folders -C ${closestPfColor} -t "$themedir" - - mkdir -p $out/share/icons - cp -r "$themedir" $out/share/icons/Papirus-Dark + for size in 22x22 24x24 32x32 48x48 64x64; do + places="$out/$size/places" + [ -d "$places" ] || continue + for f in \ + "$places/folder-${closestPfColor}"-*.svg \ + "$places/folder-${closestPfColor}.svg" \ + "$places/user-${closestPfColor}"-*.svg \ + "$places/user-${closestPfColor}.svg"; do + [ -f "$f" ] || continue + fname=$(basename "$f") + ln -sf "$fname" "$places/''${fname/-${closestPfColor}/}" + done + done ''; # Map matugen's Material You placeholders to the closest base16 slot