chore: bundle mac app and custom menu icon
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,6 +6,5 @@ coverage
|
|||||||
.pnpm-store
|
.pnpm-store
|
||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
apps/macos/.build/
|
apps/macos/.build/
|
||||||
apps/macos/Assets.xcassets/LobsterTemplate.imageset/lobster-template.pdf
|
|
||||||
bin/clawdis-mac
|
bin/clawdis-mac
|
||||||
apps/macos/.build-local/
|
apps/macos/.build-local/
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"filename" : "lobster-template.pdf",
|
|
||||||
"idiom" : "mac",
|
|
||||||
"scale" : "2x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
},
|
|
||||||
"properties" : {
|
|
||||||
"template-rendering-intent" : "template"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,6 +3,7 @@ import ApplicationServices
|
|||||||
import AsyncXPCConnection
|
import AsyncXPCConnection
|
||||||
import ClawdisIPC
|
import ClawdisIPC
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import class Foundation.Bundle
|
||||||
import OSLog
|
import OSLog
|
||||||
import CoreGraphics
|
import CoreGraphics
|
||||||
@preconcurrency import ScreenCaptureKit
|
@preconcurrency import ScreenCaptureKit
|
||||||
@@ -380,15 +381,51 @@ private struct LobsterStatusLabel: View {
|
|||||||
var isPaused: Bool
|
var isPaused: Bool
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
let imageView: Image = {
|
LobsterGlyph()
|
||||||
if let img = NSImage(named: "LobsterTemplate") {
|
.frame(width: 16, height: 16)
|
||||||
img.isTemplate = true
|
.foregroundStyle(isPaused ? .secondary : .primary)
|
||||||
return Image(nsImage: img).renderingMode(.template)
|
}
|
||||||
}
|
}
|
||||||
return Image(systemName: "antenna.radiowaves.left.and.right")
|
|
||||||
}()
|
|
||||||
|
|
||||||
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
52
scripts/package-mac-app.sh
Executable file
52
scripts/package-mac-app.sh
Executable file
@@ -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'
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>com.steipete.clawdis</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>Clawdis</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>Clawdis</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
<string>15.0</string>
|
||||||
|
<key>LSUIElement</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
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"
|
||||||
Reference in New Issue
Block a user