2026-04-13 21:03:00 +01:00
|
|
|
#!/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"
|
|
|
|
|
|
2026-04-13 21:08:07 +01:00
|
|
|
# Create index.theme with all mimetype sizes
|
2026-04-13 21:03:00 +01:00
|
|
|
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
|
|
|
|
|
|
2026-04-13 21:08:07 +01:00
|
|
|
[16x16/mimetypes]
|
|
|
|
|
Size=16
|
|
|
|
|
Type=Fixed
|
|
|
|
|
Context=MimeTypes
|
|
|
|
|
|
|
|
|
|
[22x22/mimetypes]
|
|
|
|
|
Size=22
|
|
|
|
|
Type=Fixed
|
|
|
|
|
Context=MimeTypes
|
|
|
|
|
|
|
|
|
|
[32x32/mimetypes]
|
|
|
|
|
Size=32
|
|
|
|
|
Type=Fixed
|
|
|
|
|
Context=MimeTypes
|
|
|
|
|
|
|
|
|
|
[48x48/mimetypes]
|
|
|
|
|
Size=48
|
|
|
|
|
Type=Fixed
|
|
|
|
|
Context=MimeTypes
|
|
|
|
|
|
2026-04-13 21:03:00 +01:00
|
|
|
[64x64/mimetypes]
|
|
|
|
|
Size=64
|
2026-04-13 21:08:07 +01:00
|
|
|
MinSize=32
|
|
|
|
|
MaxSize=128
|
|
|
|
|
Type=Scalable
|
|
|
|
|
Context=MimeTypes
|
|
|
|
|
|
|
|
|
|
[96x96/mimetypes]
|
|
|
|
|
Size=96
|
|
|
|
|
MinSize=64
|
|
|
|
|
MaxSize=256
|
|
|
|
|
Type=Scalable
|
|
|
|
|
Context=MimeTypes
|
|
|
|
|
|
|
|
|
|
[128x128/mimetypes]
|
|
|
|
|
Size=128
|
|
|
|
|
MinSize=64
|
2026-04-13 21:03:00 +01:00
|
|
|
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
|
|
|
|
|
|
2026-04-13 21:08:07 +01:00
|
|
|
# Copy Papirus mimetype icons at all available sizes
|
|
|
|
|
for size in 16x16 22x22 32x32 48x48 64x64 96x96 128x128; do
|
|
|
|
|
if [ -d "$PAPIRUS/$size/mimetypes" ]; then
|
2026-04-13 21:09:21 +01:00
|
|
|
rm -rf "$ICON_DIR/$size/mimetypes"
|
2026-04-13 21:08:07 +01:00
|
|
|
mkdir -p "$ICON_DIR/$size/mimetypes"
|
2026-04-13 21:09:21 +01:00
|
|
|
cp -rL "$PAPIRUS/$size/mimetypes"/* "$ICON_DIR/$size/mimetypes/"
|
2026-04-13 21:08:07 +01:00
|
|
|
fi
|
|
|
|
|
done
|
2026-04-13 21:03:00 +01:00
|
|
|
|
|
|
|
|
# Update icon cache
|
|
|
|
|
gtk-update-icon-cache -f "$ICON_DIR" 2>/dev/null || true
|
2026-04-13 21:14:54 +01:00
|
|
|
|
|
|
|
|
# Map wallpaper palette to closest GNOME accent color
|
|
|
|
|
# Primary color RGB: {{colors.primary.default.red}}, {{colors.primary.default.green}}, {{colors.primary.default.blue}}
|
|
|
|
|
R={{colors.primary.default.red}}
|
|
|
|
|
G={{colors.primary.default.green}}
|
|
|
|
|
B={{colors.primary.default.blue}}
|
|
|
|
|
|
|
|
|
|
# Simple hue-based mapping to GNOME accent presets
|
|
|
|
|
if [ "$R" -gt "$G" ] && [ "$R" -gt "$B" ]; then
|
|
|
|
|
if [ "$B" -gt "$((G + 30))" ]; then
|
|
|
|
|
ACCENT="purple"
|
|
|
|
|
elif [ "$G" -gt "$((R / 2))" ]; then
|
|
|
|
|
ACCENT="orange"
|
|
|
|
|
else
|
|
|
|
|
if [ "$B" -gt "$((R / 3))" ]; then
|
|
|
|
|
ACCENT="pink"
|
|
|
|
|
else
|
|
|
|
|
ACCENT="red"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
elif [ "$G" -gt "$R" ] && [ "$G" -gt "$B" ]; then
|
|
|
|
|
if [ "$B" -gt "$((R + 20))" ]; then
|
|
|
|
|
ACCENT="teal"
|
|
|
|
|
else
|
|
|
|
|
ACCENT="green"
|
|
|
|
|
fi
|
|
|
|
|
elif [ "$B" -gt "$R" ] && [ "$B" -gt "$G" ]; then
|
|
|
|
|
if [ "$R" -gt "$((B / 2))" ]; then
|
|
|
|
|
ACCENT="purple"
|
|
|
|
|
else
|
|
|
|
|
ACCENT="blue"
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
ACCENT="slate"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
gsettings set org.gnome.desktop.interface accent-color "$ACCENT"
|
|
|
|
|
|
|
|
|
|
# Merge VSCodium color customizations into settings.json
|
|
|
|
|
VSCODE_SETTINGS="$HOME/.config/VSCodium/User/settings.json"
|
|
|
|
|
VSCODE_COLORS="$HOME/.local/share/matugen/vscodium-colors.json"
|
|
|
|
|
if [ -f "$VSCODE_SETTINGS" ] && [ -f "$VSCODE_COLORS" ]; then
|
|
|
|
|
COLORS=$(cat "$VSCODE_COLORS")
|
|
|
|
|
# Remove existing workbench.colorCustomizations and merge new ones
|
|
|
|
|
TMP=$(mktemp)
|
|
|
|
|
if command -v jq &>/dev/null; then
|
|
|
|
|
jq --argjson colors "$COLORS" '. * $colors' "$VSCODE_SETTINGS" > "$TMP" && mv "$TMP" "$VSCODE_SETTINGS"
|
|
|
|
|
fi
|
|
|
|
|
fi
|