- Changed AI Generator shortcut from Cmd+K to Cmd+I - Cmd+K now only triggers Clear Screen - Created custom terminal-style app icon with Python/PIL - Updated build script to include icon in app bundle - Updated all documentation with correct shortcuts - New DMG with icon included (492K)
154 lines
4.5 KiB
Bash
Executable File
154 lines
4.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "🎨 Creating app icon..."
|
|
|
|
# Create a temporary directory for icon generation
|
|
ICON_DIR="icon_temp"
|
|
mkdir -p "$ICON_DIR"
|
|
|
|
# Create a simple terminal icon using SF Symbols or generate programmatically
|
|
# We'll use sips and iconutil to create an icns file
|
|
|
|
# First, let's create a base PNG image using Python (available on macOS)
|
|
python3 << 'PYTHON_SCRIPT'
|
|
from PIL import Image, ImageDraw, ImageFont
|
|
import os
|
|
|
|
# Create icon directory
|
|
os.makedirs("icon_temp/AppIcon.iconset", exist_ok=True)
|
|
|
|
# Icon sizes needed for macOS
|
|
sizes = [16, 32, 64, 128, 256, 512, 1024]
|
|
|
|
for size in sizes:
|
|
# Create image with dark background
|
|
img = Image.new('RGB', (size, size), color='#282a36')
|
|
draw = ImageDraw.Draw(img)
|
|
|
|
# Draw a terminal-like window
|
|
margin = size // 10
|
|
|
|
# Window background (slightly lighter)
|
|
draw.rectangle(
|
|
[margin, margin, size - margin, size - margin],
|
|
fill='#1e1f29',
|
|
outline='#44475a',
|
|
width=max(1, size // 128)
|
|
)
|
|
|
|
# Title bar
|
|
title_height = size // 8
|
|
draw.rectangle(
|
|
[margin, margin, size - margin, margin + title_height],
|
|
fill='#44475a'
|
|
)
|
|
|
|
# Traffic light buttons (macOS style)
|
|
button_size = max(2, size // 40)
|
|
button_y = margin + title_height // 2
|
|
button_spacing = size // 20
|
|
|
|
# Red button
|
|
draw.ellipse(
|
|
[margin + button_spacing, button_y - button_size,
|
|
margin + button_spacing + button_size * 2, button_y + button_size],
|
|
fill='#ff5555'
|
|
)
|
|
|
|
# Yellow button
|
|
draw.ellipse(
|
|
[margin + button_spacing * 2 + button_size * 2, button_y - button_size,
|
|
margin + button_spacing * 2 + button_size * 4, button_y + button_size],
|
|
fill='#f1fa8c'
|
|
)
|
|
|
|
# Green button
|
|
draw.ellipse(
|
|
[margin + button_spacing * 3 + button_size * 4, button_y - button_size,
|
|
margin + button_spacing * 3 + button_size * 6, button_y + button_size],
|
|
fill='#50fa7b'
|
|
)
|
|
|
|
# Terminal prompt symbol ">"
|
|
prompt_size = size // 3
|
|
prompt_x = size // 2 - prompt_size // 4
|
|
prompt_y = size // 2 + title_height // 2
|
|
|
|
# Draw a simple ">" prompt
|
|
line_width = max(2, size // 32)
|
|
draw.line(
|
|
[prompt_x, prompt_y - prompt_size // 2,
|
|
prompt_x + prompt_size // 2, prompt_y],
|
|
fill='#50fa7b',
|
|
width=line_width
|
|
)
|
|
draw.line(
|
|
[prompt_x + prompt_size // 2, prompt_y,
|
|
prompt_x, prompt_y + prompt_size // 2],
|
|
fill='#50fa7b',
|
|
width=line_width
|
|
)
|
|
|
|
# Draw cursor
|
|
cursor_x = prompt_x + prompt_size // 2 + size // 10
|
|
cursor_width = max(2, size // 32)
|
|
cursor_height = prompt_size // 2
|
|
draw.rectangle(
|
|
[cursor_x, prompt_y - cursor_height // 2,
|
|
cursor_x + cursor_width, prompt_y + cursor_height // 2],
|
|
fill='#f8f8f2'
|
|
)
|
|
|
|
# Save standard size
|
|
img.save(f"icon_temp/AppIcon.iconset/icon_{size}x{size}.png")
|
|
|
|
# Save @2x version for retina
|
|
if size <= 512:
|
|
img_2x = img.resize((size * 2, size * 2), Image.Resampling.LANCZOS)
|
|
img_2x.save(f"icon_temp/AppIcon.iconset/icon_{size}x{size}@2x.png")
|
|
|
|
print("✅ Icon images generated")
|
|
PYTHON_SCRIPT
|
|
|
|
# Check if Python script succeeded
|
|
if [ $? -ne 0 ]; then
|
|
echo "⚠️ PIL not available, creating simple icon..."
|
|
|
|
# Fallback: Create a simple colored square
|
|
mkdir -p "$ICON_DIR/AppIcon.iconset"
|
|
|
|
for size in 16 32 64 128 256 512 1024; do
|
|
# Create a simple gradient icon using sips
|
|
sips -z $size $size /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ExecutableBinaryIcon.icns \
|
|
--out "$ICON_DIR/AppIcon.iconset/icon_${size}x${size}.png" 2>/dev/null
|
|
|
|
if [ $size -le 512 ]; then
|
|
size2=$((size * 2))
|
|
sips -z $size2 $size2 /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ExecutableBinaryIcon.icns \
|
|
--out "$ICON_DIR/AppIcon.iconset/icon_${size}x${size}@2x.png" 2>/dev/null
|
|
fi
|
|
done
|
|
fi
|
|
|
|
# Convert iconset to icns
|
|
echo "🔨 Converting to .icns format..."
|
|
iconutil -c icns "$ICON_DIR/AppIcon.iconset" -o AppIcon.icns
|
|
|
|
if [ -f "AppIcon.icns" ]; then
|
|
echo "✅ Icon created: AppIcon.icns"
|
|
|
|
# Update the build script to include the icon
|
|
echo "📝 Updating build script to include icon..."
|
|
|
|
# Clean up
|
|
rm -rf "$ICON_DIR"
|
|
|
|
echo ""
|
|
echo "✅ Icon ready! Rebuild the app to include it."
|
|
echo " Run: ./build.sh"
|
|
else
|
|
echo "❌ Failed to create icon"
|
|
rm -rf "$ICON_DIR"
|
|
exit 1
|
|
fi
|