diff --git a/.gitignore b/.gitignore index 71db99d17..c526fed2b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,5 @@ coverage .pnpm-store **/.DS_Store apps/macos/.build/ -apps/macos/Assets.xcassets/LobsterTemplate.imageset/lobster-template.pdf bin/clawdis-mac apps/macos/.build-local/ diff --git a/apps/macos/Assets.xcassets/LobsterTemplate.imageset/Contents.json b/apps/macos/Assets.xcassets/LobsterTemplate.imageset/Contents.json deleted file mode 100644 index 80bace3a5..000000000 --- a/apps/macos/Assets.xcassets/LobsterTemplate.imageset/Contents.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "images" : [ - { - "filename" : "lobster-template.pdf", - "idiom" : "mac", - "scale" : "2x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "template-rendering-intent" : "template" - } -} diff --git a/apps/macos/Sources/Clawdis/AppMain.swift b/apps/macos/Sources/Clawdis/AppMain.swift index 918699792..6e244406c 100644 --- a/apps/macos/Sources/Clawdis/AppMain.swift +++ b/apps/macos/Sources/Clawdis/AppMain.swift @@ -3,6 +3,7 @@ import ApplicationServices import AsyncXPCConnection import ClawdisIPC import Foundation +import class Foundation.Bundle import OSLog import CoreGraphics @preconcurrency import ScreenCaptureKit @@ -380,15 +381,51 @@ private struct LobsterStatusLabel: View { var isPaused: Bool var body: some View { - let imageView: Image = { - if let img = NSImage(named: "LobsterTemplate") { - img.isTemplate = true - return Image(nsImage: img).renderingMode(.template) - } - return Image(systemName: "antenna.radiowaves.left.and.right") - }() + LobsterGlyph() + .frame(width: 16, height: 16) + .foregroundStyle(isPaused ? .secondary : .primary) + } +} - return imageView.foregroundStyle(isPaused ? .secondary : .primary) +struct LobsterGlyph: View { + var body: some View { + GeometryReader { geo in + let w = geo.size.width + let h = geo.size.height + let midX = w / 2 + let midY = h / 2 + + ZStack { + // Body + Capsule() + .frame(width: w * 0.4, height: h * 0.55) + .offset(y: h * 0.05) + // Claws + Capsule(style: .continuous) + .frame(width: w * 0.22, height: h * 0.28) + .rotationEffect(.degrees(-25)) + .offset(x: -w * 0.32, y: -h * 0.05) + Capsule(style: .continuous) + .frame(width: w * 0.22, height: h * 0.28) + .rotationEffect(.degrees(25)) + .offset(x: w * 0.32, y: -h * 0.05) + // Antennae + Path { p in + p.move(to: CGPoint(x: midX - w * 0.08, y: midY - h * 0.35)) + p.addQuadCurve(to: CGPoint(x: midX - w * 0.18, y: midY - h * 0.6), control: CGPoint(x: midX - w * 0.2, y: midY - h * 0.45)) + p.move(to: CGPoint(x: midX + w * 0.08, y: midY - h * 0.35)) + p.addQuadCurve(to: CGPoint(x: midX + w * 0.18, y: midY - h * 0.6), control: CGPoint(x: midX + w * 0.2, y: midY - h * 0.45)) + } + .stroke(lineWidth: 1.2) + // Tail segments + VStack(spacing: h * 0.04) { + Capsule().frame(width: w * 0.26, height: h * 0.12) + Capsule().frame(width: w * 0.22, height: h * 0.11) + Capsule().frame(width: w * 0.18, height: h * 0.1) + } + .offset(y: h * 0.18) + } + } } } diff --git a/scripts/package-mac-app.sh b/scripts/package-mac-app.sh new file mode 100755 index 000000000..a1fc82f1e --- /dev/null +++ b/scripts/package-mac-app.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Build and bundle Clawdis into a minimal .app we can open. +# Outputs to dist/Clawdis.app + +ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)" +APP_ROOT="$ROOT_DIR/dist/Clawdis.app" +BUILD_PATH="$ROOT_DIR/apps/macos/.build-local" +PRODUCT="Clawdis" + +cd "$ROOT_DIR/apps/macos" + +echo "๐Ÿ”จ Building $PRODUCT (debug)" +swift build -c debug --product "$PRODUCT" --build-path "$BUILD_PATH" + +BIN="$BUILD_PATH/debug/$PRODUCT" +echo "๐Ÿงน Cleaning old app bundle" +rm -rf "$APP_ROOT" +mkdir -p "$APP_ROOT/Contents/MacOS" +mkdir -p "$APP_ROOT/Contents/Resources" + +echo "๐Ÿ“„ Writing Info.plist" +cat > "$APP_ROOT/Contents/Info.plist" <<'PLIST' + + + + + CFBundleIdentifier + com.steipete.clawdis + CFBundleName + Clawdis + CFBundleExecutable + Clawdis + CFBundlePackageType + APPL + LSMinimumSystemVersion + 15.0 + LSUIElement + + + +PLIST + +echo "๐Ÿšš Copying binary" +cp "$BIN" "$APP_ROOT/Contents/MacOS/Clawdis" +chmod +x "$APP_ROOT/Contents/MacOS/Clawdis" + +echo "โœ… Bundle ready at $APP_ROOT" + +echo "๐Ÿš€ Launching app" +open "$APP_ROOT"