spb/forge-studio Public
The Instruments of LLM training — a native macOS cockpit for Forge. Train language models from scratch on Apple Silicon without a terminal.
Swift 95.7%
Shell 4.3%
1#!/bin/bash2# Author: Simon-Pierre Boucher — contact@spboucher.ai3# Renders the Forge Studio app icon (anvil-flame motif: forge gradient +4# SF Symbol flame) at 1024px with AppKit, then builds AppIcon.icns.5set -euo pipefail6cd "$(dirname "$0")/.."7mkdir -p Assets89cat > /tmp/forge-studio-icon.swift <<'SWIFT'10// Author: Simon-Pierre Boucher — contact@spboucher.ai11import AppKit1213let size = CGFloat(1024)14let image = NSImage(size: NSSize(width: size, height: size))15image.lockFocus()1617// macOS-style rounded rect with a forge-heat gradient.18let inset = size * 0.0819let rect = NSRect(x: inset, y: inset, width: size - 2 * inset, height: size - 2 * inset)20let path = NSBezierPath(roundedRect: rect, xRadius: size * 0.18, yRadius: size * 0.18)21NSGradient(colors: [22 NSColor(calibratedRed: 0.10, green: 0.10, blue: 0.14, alpha: 1),23 NSColor(calibratedRed: 0.22, green: 0.12, blue: 0.08, alpha: 1),24])!.draw(in: path, angle: -90)2526// Flame glyph, forge-orange with a warm glow.27let config = NSImage.SymbolConfiguration(pointSize: size * 0.52, weight: .semibold)28if let flame = NSImage(systemSymbolName: "flame.fill",29 accessibilityDescription: nil)?30 .withSymbolConfiguration(config) {31 let tinted = NSImage(size: flame.size)32 tinted.lockFocus()33 NSColor(calibratedRed: 1.0, green: 0.55, blue: 0.15, alpha: 1).set()34 let r = NSRect(origin: .zero, size: flame.size)35 flame.draw(in: r)36 r.fill(using: .sourceAtop)37 tinted.unlockFocus()38 let fr = NSRect(x: (size - flame.size.width) / 2,39 y: (size - flame.size.height) / 2 + size * 0.02,40 width: flame.size.width, height: flame.size.height)41 NSGraphicsContext.current?.cgContext.setShadow(42 offset: .zero, blur: size * 0.06,43 color: NSColor.orange.withAlphaComponent(0.8).cgColor)44 tinted.draw(in: fr)45}4647image.unlockFocus()48let tiff = image.tiffRepresentation!49let png = NSBitmapImageRep(data: tiff)!.representation(using: .png, properties: [:])!50try! png.write(to: URL(fileURLWithPath: "Assets/icon-1024.png"))51print("Assets/icon-1024.png")52SWIFT53swift /tmp/forge-studio-icon.swift5455ICONSET="Assets/AppIcon.iconset"56rm -rf "$ICONSET" && mkdir -p "$ICONSET"57for s in 16 32 128 256 512; do58 sips -z $s $s Assets/icon-1024.png --out "$ICONSET/icon_${s}x${s}.png" >/dev/null59 d=$((s * 2))60 sips -z $d $d Assets/icon-1024.png --out "$ICONSET/icon_${s}x${s}@2x.png" >/dev/null61done62iconutil -c icns "$ICONSET" -o Assets/AppIcon.icns63echo "OK: Assets/AppIcon.icns"64