#!/usr/bin/env bash # scripts/render-icons.sh: render the canonical sheaf mark (packaging/linux/ # sheaf.svg) into the hicolor PNG size set under build/icons/, plus the master # build/appicon.png and the Windows .ico. Single source of truth: edit the # SVG, re-run this. Requires rsvg-convert (librsvg) and ImageMagick. # # bash scripts/render-icons.sh set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" SVG="$REPO_ROOT/packaging/linux/sheaf.svg" ICON_NAME="com.doubledecimal.sheaf" # reverse-DNS; matches the .desktop + app-id SIZES=(16 32 48 64 128 256 512 1024) command -v rsvg-convert >/dev/null || { echo "need rsvg-convert (librsvg)" >&2; exit 1; } command -v magick >/dev/null || { echo "need ImageMagick (magick)" >&2; exit 1; } # per-size PNGs for hicolor ($size x $size/apps/.png) for s in "${SIZES[@]}"; do out="$REPO_ROOT/build/icons/${s}x${s}" mkdir -p "$out" rsvg-convert -w "$s" -h "$s" "$SVG" -o "$out/${ICON_NAME}.png" done # master PNG that Wails embeds (Linux runtime icon) and uses for packaging rsvg-convert -w 1024 -h 1024 "$SVG" -o "$REPO_ROOT/build/appicon.png" # Windows icon resource magick "$REPO_ROOT/build/appicon.png" \ -define icon:auto-resize=256,128,96,64,48,32,16 \ "$REPO_ROOT/build/windows/icon.ico" echo "rendered icons from $(basename "$SVG") -> build/icons/ (${ICON_NAME}.png), build/appicon.png, build/windows/icon.ico"