This commit is contained in:
ediblerope 2026-05-15 22:47:46 +01:00
parent fb03921bfb
commit 58342373e8

View file

@ -83,12 +83,15 @@
# colored variant (folder-{color}-*.svg), symlink the generic name
# (folder-*.svg) to it. No papirus-folders binary needed.
papirusDark = pkgs.runCommand "papirus-dark-${closestPfColor}" {} ''
mkdir -p $out/share/icons
cp -r ${pkgs.papirus-icon-theme}/share/icons/Papirus-Dark $out/share/icons/
chmod -R u+w $out/share/icons/Papirus-Dark
# Copy full icon tree so Papirus-Dark's ../Papirus/… symlinks resolve.
tmpthemes=$(mktemp -d)
cp -r ${pkgs.papirus-icon-theme}/share/icons/. "$tmpthemes/"
chmod -R u+w "$tmpthemes"
# Recolor folders. Papirus-Dark delegates 48x48 etc. to ../Papirus via
# symlinks, so we operate through those resolved paths in the temp tree.
for size in 22x22 24x24 32x32 48x48 64x64; do
places="$out/share/icons/Papirus-Dark/$size/places"
places="$tmpthemes/Papirus-Dark/$size/places"
[ -d "$places" ] || continue
for f in \
"$places/folder-${closestPfColor}"-*.svg \
@ -100,6 +103,11 @@
ln -sf "$fname" "$places/''${fname/-${closestPfColor}/}"
done
done
# Copy Papirus-Dark with -L to dereference all symlinks, so the output
# is self-contained — no dangling ../Papirus/… pointers.
mkdir -p $out/share/icons
cp -rL "$tmpthemes/Papirus-Dark" $out/share/icons/
'';
# Map matugen's Material You placeholders to the closest base16 slot