Initial commit: a Copper-style panel for prompts and photos

Keeps text prompts and photos in a floating always-on-top panel and
copies them back to the clipboard on click. Double-Shift captures the
selection from any app; sections, search, copy-as-list, merge, and
local JSON persistence mirror shadcn's Copper workflow.

💘 Generated with Crush

Assisted-by: Crush:kimi-k3
This commit is contained in:
2026-10-07 20:54:49 +08:00
commit c074be3378
14 changed files with 1675 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
import AppKit
let size = NSSize(width: 1024, height: 1024)
guard let rep = NSBitmapImageRep(
bitmapDataPlanes: nil, pixelsWide: 1024, pixelsHigh: 1024,
bitsPerSample: 8, samplesPerPixel: 4, hasAlpha: true, isPlanar: false,
colorSpaceName: .deviceRGB, bytesPerRow: 0, bitsPerPixel: 0
) else { exit(1) }
NSGraphicsContext.saveGraphicsState()
NSGraphicsContext.current = NSGraphicsContext(bitmapImageRep: rep)
NSGraphicsContext.current?.imageInterpolation = .high
// Dark rounded tile.
let tile = NSBezierPath(roundedRect: NSRect(x: 112, y: 112, width: 800, height: 800), xRadius: 180, yRadius: 180)
let gradient = NSGradient(colors: [
NSColor(calibratedRed: 0.16, green: 0.17, blue: 0.22, alpha: 1),
NSColor(calibratedRed: 0.07, green: 0.08, blue: 0.11, alpha: 1),
])!
gradient.draw(in: tile, angle: -90)
// Terminal-style prompt glyph: chevron + cursor block.
NSColor(calibratedRed: 0.40, green: 0.85, blue: 0.55, alpha: 1).setStroke()
let chevron = NSBezierPath()
chevron.move(to: NSPoint(x: 300, y: 640))
chevron.line(to: NSPoint(x: 470, y: 512))
chevron.line(to: NSPoint(x: 300, y: 384))
chevron.lineWidth = 74
chevron.lineCapStyle = .round
chevron.lineJoinStyle = .round
chevron.stroke()
NSColor(calibratedRed: 0.40, green: 0.85, blue: 0.55, alpha: 1).setFill()
let cursor = NSBezierPath(roundedRect: NSRect(x: 560, y: 384, width: 150, height: 84), xRadius: 16, yRadius: 16)
cursor.fill()
NSGraphicsContext.restoreGraphicsState()
guard let data = rep.representation(using: .png, properties: [:]) else { exit(1) }
if CommandLine.arguments.count < 2 { exit(1) }
do {
try data.write(to: URL(fileURLWithPath: CommandLine.arguments[1]))
} catch {
exit(1)
}
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")/.."
TMP=$(mktemp -d)
trap 'rm -rf "$TMP"' EXIT
swift scripts/gen-icon.swift "$TMP/icon-1024.png"
mkdir -p "$TMP/Icon.iconset"
for s in 16 32 128 256 512; do
d=$((s * 2))
sips -z "$s" "$s" "$TMP/icon-1024.png" --out "$TMP/Icon.iconset/icon_${s}x${s}.png" >/dev/null
sips -z "$d" "$d" "$TMP/icon-1024.png" --out "$TMP/Icon.iconset/icon_${s}x${s}@2x.png" >/dev/null
done
iconutil -c icns "$TMP/Icon.iconset" -o "$TMP/Icon.icns"
mkdir -p Prompt.app/Contents/Resources
cp "$TMP/Icon.icns" Prompt.app/Contents/Resources/Icon.icns
echo "Generated Prompt.app/Contents/Resources/Icon.icns"