Add Papirus mimetype icons to WallpaperAdwaita theme

Copies Papirus-Dark mimetype icons into WallpaperAdwaita for
distinctive file type icons (json, python, markdown, etc.)
while keeping the wallpaper-colored folder icons from Adwaita.

Also fixes recolor script to process all place icons, not just
folders (fixes Desktop icon), and improves color mapping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ediblerope 2026-04-13 21:03:00 +01:00
parent 0a1ffe201f
commit 043dd3674c
3 changed files with 59 additions and 1 deletions

View file

@ -0,0 +1,52 @@
#!/bin/bash
# Generated by matugen — recolors Adwaita folder icons with wallpaper palette
# and pulls in Papirus mimetype icons for better file type distinction
ICON_DIR="$HOME/.local/share/icons/WallpaperAdwaita"
ADWAITA="/run/current-system/sw/share/icons/Adwaita"
PAPIRUS="/run/current-system/sw/share/icons/Papirus-Dark"
mkdir -p "$ICON_DIR/scalable/places"
# Create index.theme
cat > "$ICON_DIR/index.theme" << 'THEME'
[Icon Theme]
Name=WallpaperAdwaita
Comment=Adwaita with wallpaper-colored folders and Papirus mimetypes
Inherits=Adwaita,hicolor
DisplayDepth=32
[scalable/places]
Size=128
MinSize=16
MaxSize=512
Type=Scalable
Context=Places
[64x64/mimetypes]
Size=64
MinSize=16
MaxSize=512
Type=Scalable
Context=MimeTypes
THEME
# Recolor all Adwaita place SVGs with wallpaper palette
for svg in "$ADWAITA/scalable/places"/*.svg; do
name=$(basename "$svg")
sed \
-e 's/#438de6/{{colors.primary_container.default.hex}}/gi' \
-e 's/#62a0ea/{{colors.primary_fixed_dim.default.hex}}/gi' \
-e 's/#a4caee/{{colors.primary_fixed.default.hex}}/gi' \
-e 's/#afd4ff/{{colors.primary_fixed.default.hex}}/gi' \
-e 's/#c0d5ea/{{colors.primary_fixed.default.hex}}/gi' \
"$svg" > "$ICON_DIR/scalable/places/$name"
done
# Copy Papirus mimetype icons for better file type distinction
if [ -d "$PAPIRUS/64x64/mimetypes" ]; then
mkdir -p "$ICON_DIR/64x64/mimetypes"
cp -a "$PAPIRUS/64x64/mimetypes"/* "$ICON_DIR/64x64/mimetypes/"
fi
# Update icon cache
gtk-update-icon-cache -f "$ICON_DIR" 2>/dev/null || true