-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-app-bundle.sh
More file actions
executable file
·125 lines (107 loc) · 3.82 KB
/
Copy pathcreate-app-bundle.sh
File metadata and controls
executable file
·125 lines (107 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash
# create-app-bundle.sh — Create proper macOS .app bundle
APP_NAME="SyncVold"
BUILD_DIR=".build/release"
APP_BUNDLE="$BUILD_DIR/$APP_NAME.app"
CONTENTS="$APP_BUNDLE/Contents"
MACOS="$CONTENTS/MacOS"
RESOURCES="$CONTENTS/Resources"
echo "Creating $APP_NAME.app bundle..."
# Clean previous bundle
rm -rf "$APP_BUNDLE"
# Create bundle structure
mkdir -p "$MACOS"
mkdir -p "$RESOURCES"
# Copy executable
cp "$BUILD_DIR/$APP_NAME" "$MACOS/"
# Create Info.plist
cat > "$CONTENTS/Info.plist" << 'EOF'
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>SyncVold</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundleIdentifier</key>
<string>com.syncvold.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>SyncVold</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>13.0</string>
<key>LSUIElement</key>
<false/>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2025. All rights reserved.</string>
<key>NSAppleEventsUsageDescription</key>
<string>SyncVold needs access to control media keys for volume synchronization.</string>
<key>NSSystemAdministrationUsageDescription</key>
<string>SyncVold needs access to monitor media keys for volume control.</string>
</dict>
</plist>
EOF
# Create icon using SF Symbols (speaker.wave.3.fill)
# For now, we'll use a simple script to generate an icns file
python3 << 'PYTHON'
from PIL import Image, ImageDraw
import os
# Create icon at multiple sizes
sizes = [16, 32, 64, 128, 256, 512, 1024]
icon_dir = ".build/release/SyncVold.app/Contents/Resources"
for size in sizes:
img = Image.new('RGBA', (size, size), (0, 0, 0, 0))
draw = ImageDraw.Draw(img)
# Draw a simple speaker icon
# Background circle
margin = size // 8
draw.ellipse([margin, margin, size-margin, size-margin], fill='#007AFF')
# Speaker shape (simplified)
speaker_margin = size // 4
draw.rectangle([speaker_margin, speaker_margin + size//8,
speaker_margin + size//8, size - speaker_margin - size//8],
fill='white')
# Sound waves
for i in range(3):
offset = speaker_margin + size//8 + size//16 + i * size//12
wave_y = size // 2
draw.arc([offset, wave_y - size//12, offset + size//8, wave_y + size//12],
start=-45, end=45, fill='white', width=max(2, size//64))
img.save(f'{icon_dir}/AppIcon_{size}x{size}.png')
print("✓ Icon images created")
PYTHON
# Try to create icns file (requires iconutil on macOS)
if command -v iconutil &> /dev/null; then
ICONSET="$RESOURCES/AppIcon.iconset"
mkdir -p "$ICONSET"
# Copy and rename for iconset
for size in 16 32 128 256 512; do
size2=$((size * 2))
if [ -f "$RESOURCES/AppIcon_${size}x${size}.png" ]; then
cp "$RESOURCES/AppIcon_${size}x${size}.png" "$ICONSET/icon_${size}x${size}.png"
fi
if [ -f "$RESOURCES/AppIcon_${size2}x${size2}.png" ]; then
cp "$RESOURCES/AppIcon_${size2}x${size2}.png" "$ICONSET/icon_${size}x${size}@2x.png"
fi
done
iconutil -c icns "$ICONSET" -o "$RESOURCES/AppIcon.icns"
rm -rf "$ICONSET"
echo "✓ AppIcon.icns created"
fi
echo ""
echo "✓ $APP_NAME.app bundle created successfully!"
echo " Location: $APP_BUNDLE"
echo ""
echo "To run: open $APP_BUNDLE"