#!/bin/bash # # generate-icon.sh # Zyquo Router # # Author: Simon-Pierre Boucher # Mail: contact@spboucher.ai # # SVG → AppIcon.icns + menu bar template PNGs. The SVGs in assets/icon are # the source of truth; 16/32 px slices come from the simplified variant # (the routing fan reads as noise below 64 px). # set -euo pipefail cd "$(dirname "$0")/.." SVG=assets/icon/zyquo-router.svg SVG_SMALL=assets/icon/zyquo-router-small.svg SVG_TEMPLATE=assets/icon/zyquo-router-template.svg ICONSET=.build/AppIcon.iconset command -v rsvg-convert >/dev/null || { echo "rsvg-convert not found (brew install librsvg)"; exit 1; } rm -rf "$ICONSET" mkdir -p "$ICONSET" Resources render() { rsvg-convert -w "$2" -h "$2" "$1" -o "$ICONSET/$3"; } # Small sizes from the simplified variant. render "$SVG_SMALL" 16 icon_16x16.png render "$SVG_SMALL" 32 icon_16x16@2x.png render "$SVG_SMALL" 32 icon_32x32.png render "$SVG" 64 icon_32x32@2x.png # Full art from 128 up. render "$SVG" 128 icon_128x128.png render "$SVG" 256 icon_128x128@2x.png render "$SVG" 256 icon_256x256.png render "$SVG" 512 icon_256x256@2x.png render "$SVG" 512 icon_512x512.png render "$SVG" 1024 icon_512x512@2x.png iconutil -c icns "$ICONSET" -o Resources/AppIcon.icns echo "Resources/AppIcon.icns written" # Menu bar template glyph (18 pt @1x/@2x). rsvg-convert -w 18 -h 18 "$SVG_TEMPLATE" -o Resources/MenuBarIcon.png rsvg-convert -w 36 -h 36 "$SVG_TEMPLATE" -o Resources/MenuBarIcon@2x.png echo "Resources/MenuBarIcon(@2x).png written"