quickshell: index all YAMIS dirs, not just apps, for icon tinting

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-08-21 16:59:21 +01:00
parent e6b63d4eb1
commit c3e8691c2c

View file

@ -20,7 +20,7 @@ let
themeApply = config.fred.theming.apply; themeApply = config.fred.theming.apply;
monoIcons = config.fred.theming.monoIcons; monoIcons = config.fred.theming.monoIcons;
# The set of app icons YAMIS actually ships, as a QML singleton. # Every icon name YAMIS ships, as a QML singleton.
# #
# AppIcon needs to know whether a given icon came from the monochrome set # AppIcon needs to know whether a given icon came from the monochrome set
# (safe to flatten to one colour) or fell through to Papirus (not — see the # (safe to flatten to one colour) or fell through to Papirus (not — see the
@ -29,6 +29,17 @@ let
# so there is no store path or theme directory in it to match on. The name # so there is no store path or theme directory in it to match on. The name
# is all we get, so the name is what we test. # is all we get, so the name is what we test.
# #
# Membership is the whole predicate: YAMIS leads Papirus-Fred's Inherits, so
# a name it ships is a name it serves. Every directory counts, not just
# apps/ — desktop entries reach into the other contexts freely (nm-connection
# -editor asks for preferences-system-network, which lives in preferences/),
# and an apps-only list left those rendering at the baked #d8dee9 while
# everything around them tinted.
#
# places/ is the exception: Papirus-Fred overrides the folder faces in its
# own directory, which outranks anything inherited, so those resolve to the
# wallpaper-coloured Papirus artwork and flattening them would undo the tint.
#
# Built here rather than listed at eval time: reading the icon tree during # Built here rather than listed at eval time: reading the icon tree during
# evaluation would mean IFD, and hosts evaluate this straight from the # evaluation would mean IFD, and hosts evaluate this straight from the
# Forgejo remote. # Forgejo remote.
@ -38,10 +49,9 @@ let
echo "import QtQuick" echo "import QtQuick"
echo "QtObject {" echo "QtObject {"
printf ' readonly property var names: [' printf ' readonly property var names: ['
for f in ${monoIcons}/apps/16/*.svg ${monoIcons}/apps/scalable/*.svg; do find ${monoIcons} -path '*/places/*' -prune -o -name '*.svg' -print \
[ -e "$f" ] || continue | while read -r f; do basename "$f" .svg; done \
basename "$f" .svg | sort -u | while read -r n; do printf '"%s",' "$n"; done
done | sort -u | while read -r n; do printf '"%s",' "$n"; done
printf ']\n' printf ']\n'
echo "}" echo "}"
} > $out } > $out