Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

build: add a drag-to-Applications layout to the Mac DMG

leepokaiea9a67a66bb7
diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml
index c6ba1f43..8d4dea7e 100644
--- a/.github/workflows/release-macos.yml
+++ b/.github/workflows/release-macos.yml
@@ -108,9 +108,13 @@ jobs:
DMG_DIR=$RUNNER_TEMP/dmg_staging
mkdir -p "$DMG_DIR"
cp -R "$RUNNER_TEMP/Codync.app" "$DMG_DIR/"
- ln -s /Applications "$DMG_DIR/Applications"
- hdiutil create -volname "Codync" -srcfolder "$DMG_DIR" \
- -ov -format UDZO build/codync-macos.dmg
+ brew install create-dmg
+ swift packaging/dmg/background.swift "$RUNNER_TEMP/dmg-background.tiff"
+ create-dmg --volname Codync --background "$RUNNER_TEMP/dmg-background.tiff" \
+ --window-size 660 400 --icon-size 128 --text-size 13 \
+ --icon Codync.app 170 200 --hide-extension Codync.app \
+ --app-drop-link 490 200 --no-internet-enable \
+ build/codync-macos.dmg "$DMG_DIR"
spctl --assess --type execute -v "$RUNNER_TEMP/Codync.app"
- name: Generate signed Sparkle appcast
diff --git a/packaging/dmg/background.swift b/packaging/dmg/background.swift
new file mode 100644
index 00000000..d9839264
--- /dev/null
+++ b/packaging/dmg/background.swift
@@ -0,0 +1,58 @@
+// Draws the DMG window background: `swift background.swift <out.tiff>`.
+// 660×400 points (1x + 2x in one TIFF); icons sit at (170, 200) and (490, 200), see release-macos.yml.
+import AppKit
+
+let size = NSSize(width: 660, height: 400)
+
+func render(scale: CGFloat) -> NSBitmapImageRep {
+ let rep = NSBitmapImageRep(
+ bitmapDataPlanes: nil, pixelsWide: Int(size.width * scale), pixelsHigh: Int(size.height * scale),
+ bitsPerSample: 8, samplesPerPixel: 4, hasAlpha: true, isPlanar: false,
+ colorSpaceName: .deviceRGB, bytesPerRow: 0, bitsPerPixel: 0
+ )!
+ rep.size = size
+ NSGraphicsContext.saveGraphicsState()
+ NSGraphicsContext.current = NSGraphicsContext(bitmapImageRep: rep)
+
+ NSGradient(starting: NSColor(white: 1, alpha: 1), ending: NSColor(white: 0.94, alpha: 1))!
+ .draw(in: NSRect(origin: .zero, size: size), angle: -90)
+
+ // Arrow between the two icons (Finder's y grows down; AppKit's grows up).
+ let y = size.height - 200
+ let gray = NSColor(white: 0.62, alpha: 1)
+ gray.setStroke()
+ let line = NSBezierPath()
+ line.move(to: NSPoint(x: 262, y: y))
+ line.line(to: NSPoint(x: 392, y: y))
+ line.lineWidth = 3
+ line.lineCapStyle = .round
+ line.setLineDash([2, 9], count: 2, phase: 0)
+ line.stroke()
+ let head = NSBezierPath()
+ head.move(to: NSPoint(x: 386, y: y + 11))
+ head.line(to: NSPoint(x: 400, y: y))
+ head.line(to: NSPoint(x: 386, y: y - 11))
+ head.lineWidth = 3
+ head.lineCapStyle = .round
+ head.lineJoinStyle = .round
+ head.stroke()
+
+ let title = NSAttributedString(string: "Drag Codync to Applications", attributes: [
+ .font: NSFont.systemFont(ofSize: 17, weight: .semibold),
+ .foregroundColor: NSColor(white: 0.15, alpha: 1),
+ ])
+ title.draw(at: NSPoint(x: (size.width - title.size().width) / 2, y: size.height - 72))
+ let hint = NSAttributedString(string: "Then open Codync and install the host from its window.", attributes: [
+ .font: NSFont.systemFont(ofSize: 12),
+ .foregroundColor: NSColor(white: 0.45, alpha: 1),
+ ])
+ hint.draw(at: NSPoint(x: (size.width - hint.size().width) / 2, y: 48))
+
+ NSGraphicsContext.restoreGraphicsState()
+ return rep
+}
+
+let image = NSImage(size: size)
+image.addRepresentation(render(scale: 1))
+image.addRepresentation(render(scale: 2))
+try! image.tiffRepresentation(using: .lzw, factor: 0)!.write(to: URL(fileURLWithPath: CommandLine.arguments[1]))