#!/bin/bash # ============================================================================= # VibeQuant (vquant) — AI-Powered Financial Intelligence Platform # ----------------------------------------------------------------------------- # File: desktop/create-icon.sh # # Author: Simon-Pierre Boucher # Contact: contact@spboucher.ai # Website: https://www.spboucher.ai # Demo: https://www.vquant.ai # License: MIT (see LICENSE) # # Copyright © 2026 Simon-Pierre Boucher. All rights reserved. # ============================================================================= # Generate macOS .icns from SVG logo # Requires: rsvg-convert (librsvg) and iconutil set -e cd "$(dirname "$0")" SVG="../public/logo-vibequant.svg" ICONSET="icons/VQuant.iconset" mkdir -p "$ICONSET" # If rsvg-convert available, use SVG; otherwise create a simple PNG if command -v rsvg-convert &>/dev/null; then for SIZE in 16 32 64 128 256 512 1024; do rsvg-convert -w $SIZE -h $SIZE "$SVG" > "$ICONSET/icon_${SIZE}x${SIZE}.png" done cp "$ICONSET/icon_32x32.png" "$ICONSET/icon_16x16@2x.png" cp "$ICONSET/icon_64x64.png" "$ICONSET/icon_32x32@2x.png" cp "$ICONSET/icon_256x256.png" "$ICONSET/icon_128x128@2x.png" cp "$ICONSET/icon_512x512.png" "$ICONSET/icon_256x256@2x.png" cp "$ICONSET/icon_1024x1024.png" "$ICONSET/icon_512x512@2x.png" rm -f "$ICONSET/icon_64x64.png" "$ICONSET/icon_1024x1024.png" elif command -v sips &>/dev/null; then # Use sips (macOS built-in) with a placeholder PNG echo "rsvg-convert not found. Creating placeholder icon with sips..." # Create a simple colored square as PNG using Python python3 -c " import struct, zlib def create_png(size, r, g, b): raw = b'' for y in range(size): raw += b'\x00' for x in range(size): cx, cy = x - size//2, y - size//2 dist = (cx*cx + cy*cy) ** 0.5 if dist < size * 0.4: raw += bytes([r, g, b, 255]) elif dist < size * 0.45: alpha = max(0, min(255, int(255 * (1 - (dist - size*0.4) / (size*0.05))))) raw += bytes([r, g, b, alpha]) else: raw += bytes([0, 0, 0, 0]) def chunk(ctype, data): c = ctype + data return struct.pack('>I', len(data)) + c + struct.pack('>I', zlib.crc32(c) & 0xFFFFFFFF) header = b'\x89PNG\r\n\x1a\n' ihdr = chunk(b'IHDR', struct.pack('>IIBBBBB', size, size, 8, 6, 0, 0, 0)) idat = chunk(b'IDAT', zlib.compress(raw)) iend = chunk(b'IEND', b'') return header + ihdr + idat + iend with open('$ICONSET/icon_1024x1024.png', 'wb') as f: f.write(create_png(1024, 0, 113, 227)) " for SIZE in 16 32 128 256 512; do sips -z $SIZE $SIZE "$ICONSET/icon_1024x1024.png" --out "$ICONSET/icon_${SIZE}x${SIZE}.png" > /dev/null 2>&1 done for SIZE in 16 32 128 256 512; do DOUBLE=$((SIZE * 2)) sips -z $DOUBLE $DOUBLE "$ICONSET/icon_1024x1024.png" --out "$ICONSET/icon_${SIZE}x${SIZE}@2x.png" > /dev/null 2>&1 done rm -f "$ICONSET/icon_1024x1024.png" else echo "Cannot generate icon. Install librsvg: brew install librsvg" exit 1 fi # Generate .icns if command -v iconutil &>/dev/null; then iconutil -c icns "$ICONSET" -o icons/icon.icns echo "Created icons/icon.icns" else echo "iconutil not found (macOS only)" fi rm -rf "$ICONSET" echo "Done!"