#!/bin/bash # # generate-icon.sh # Zyquo Cloud # # Author: Simon-Pierre Boucher # Mail: contact@spboucher.ai # # SVG → Resources/AppIcon.icns + menu bar template PNGs. # Sources of truth: assets/icon/zyquo-cloud.svg (128px+ slots), # assets/icon/zyquo-cloud-small.svg (16/32px slots — simplified variant), # assets/icon/zyquo-cloud-template.svg (menu bar glyph). # Rasterized with scripts/rasterize-svg.swift (AppKit/CoreSVG; librsvg not # installed on this machine). # set -euo pipefail cd "$(dirname "$0")/.." SVG=assets/icon/zyquo-cloud.svg SVG_SMALL=assets/icon/zyquo-cloud-small.svg SVG_TEMPLATE=assets/icon/zyquo-cloud-template.svg ICONSET=$(mktemp -d)/AppIcon.iconset mkdir -p "$ICONSET" Resources render() { swift scripts/rasterize-svg.swift "$1" "$2" "$3"; } echo "=== Rendering iconset ===" render "$SVG_SMALL" "$ICONSET/icon_16x16.png" 16 render "$SVG_SMALL" "$ICONSET/icon_16x16@2x.png" 32 render "$SVG_SMALL" "$ICONSET/icon_32x32.png" 32 render "$SVG_SMALL" "$ICONSET/icon_32x32@2x.png" 64 render "$SVG" "$ICONSET/icon_128x128.png" 128 render "$SVG" "$ICONSET/icon_128x128@2x.png" 256 render "$SVG" "$ICONSET/icon_256x256.png" 256 render "$SVG" "$ICONSET/icon_256x256@2x.png" 512 render "$SVG" "$ICONSET/icon_512x512.png" 512 render "$SVG" "$ICONSET/icon_512x512@2x.png" 1024 echo "=== Building icns ===" iconutil -c icns "$ICONSET" -o Resources/AppIcon.icns echo "=== Menu bar template icon (18pt @1x/@2x) ===" render "$SVG_TEMPLATE" Resources/MenuBarIcon.png 18 render "$SVG_TEMPLATE" Resources/MenuBarIcon@2x.png 36 rm -rf "$(dirname "$ICONSET")" echo "Done: Resources/AppIcon.icns + Resources/MenuBarIcon(@2x).png"