Skip to content

👾 Open Computer Use – Open-Source Alternative to Codex Computer Use

fix: reuse open computer use icon for cursor motion

Leo19ef2e7909ed
diff --git a/docs/exec-plans/active/20260418-standalone-cursor-lab.md b/docs/exec-plans/active/20260418-standalone-cursor-lab.md
index 45804a2..0319e56 100644
--- a/docs/exec-plans/active/20260418-standalone-cursor-lab.md
+++ b/docs/exec-plans/active/20260418-standalone-cursor-lab.md
@@ -86,6 +86,7 @@
- 2026-04-20:已把独立 demo 的对外命名统一收口到 `Cursor Motion` / `CursorMotion`;Swift Package product、实验目录、README 入口和相关文档现在都以 `swift run CursorMotion` 为准,不再保留 `StandaloneCursorLab` 旧名。
- 2026-04-20:已补一条 tag 驱动的 `Cursor Motion` 分发链路;本地可以通过 `scripts/build-cursor-motion-dmg.sh` 构建 DMG,GitHub Actions 在推送 release tag 后会自动生成 `CursorMotion-<version>.dmg` 并上传到 GitHub Releases。
- 2026-04-20:继续修正“打包版和 `swift run CursorMotion` 观感不一致”的问题;当前已确认 release app 之前没把官方 `252x252` baseline cursor PNG 带进 bundle,导致退回 procedural glyph。现在 `.app` 会优先从 `Bundle.main` 读官方 cursor 图,DMG 打包脚本也会把这张图复制进 `Contents/Resources`,并显式打开 `NSHighResolutionCapable`。
+- 2026-04-20:继续修正 packaged `Cursor Motion` 没有 app icon 的问题;当前先直接复用 `Open Computer Use` 现有的 icon render 流程,在 DMG 打包阶段生成 `CursorMotion.icns` 并写入 `CFBundleIconFile`,让 Finder / Dock 不再只显示通用占位图标。
## 决策记录
@@ -103,3 +104,4 @@
- 2026-04-20:调左上角 slider 时,path 重建现在统一基于当前会话里最近一次 move 的 reference origin / startRotation / `queuedTarget`,而不是外层 `@State start/end` 或 settled 后的 live endpoint;这样参数调节既不会把曲线起点误拉回初始位置,也不会把 DEBUG 反馈线消成零长度。
- 2026-04-20:对 `Cursor Motion` 的对外交付,当前采用“源码运行 + GitHub Releases 分发 ad-hoc signed DMG”的策略;先把 tag 驱动的可复现封装链路稳定下来,不在这一轮提前引入 notarization 和 Developer ID 签名复杂度。
- 2026-04-20:对 packaged `Cursor Motion` 的 glyph 资源,当前采用“bundle 内官方 baseline 图优先,仓库 reference 路径兜底”的策略;这样 release app 不再因为缺资源而静默退回低保真的 procedural glyph。
+- 2026-04-20:对 packaged `Cursor Motion` 的 app icon,当前采用“先直接复用 `Open Computer Use` 的现有 `.icns` 渲染脚本”的策略;先解决 Finder / DMG 里的无图标问题,后续如果需要再单独设计专属 icon。
diff --git a/docs/histories/2026-04/20260418-1430-standalone-cursor-lab.md b/docs/histories/2026-04/20260418-1430-standalone-cursor-lab.md
index d475a79..75ac397 100644
--- a/docs/histories/2026-04/20260418-1430-standalone-cursor-lab.md
+++ b/docs/histories/2026-04/20260418-1430-standalone-cursor-lab.md
@@ -393,3 +393,16 @@
### 📁 Additional Files Modified
- `experiments/CursorMotion/Sources/CursorMotion/SynthesizedCursorGlyphView.swift`
- `scripts/build-cursor-motion-dmg.sh`
+
+### 🔁 Follow-up (2026-04-20, reuse Open Computer Use logo for packaged Cursor Motion icon)
+**Scope:** `scripts/`、`docs/`
+
+**Key Actions:**
+- **[定位到是 bundle icon 缺失]**: 用户继续指出 DMG 里的 `Cursor Motion.app` 仍然显示 Finder 通用占位图标;确认这次不是 cursor glyph 资源问题,而是 `.app` 的 `Info.plist` 还没有 `CFBundleIconFile`,同时 bundle 里也没有 `.icns`。
+- **[直接复用现有 icon render 链路]**: `build-cursor-motion-dmg.sh` 现在直接复用 `scripts/render-open-computer-use-icon.swift` 生成 `CursorMotion.icns`,先让 packaged `Cursor Motion` 使用 `Open Computer Use` 的现有 logo。
+- **[补 bundle icon 声明]**: 打包脚本会把 `CursorMotion.icns` 写入 `Contents/Resources/`,并在 `Info.plist` 里补 `CFBundleIconFile=CursorMotion.icns`,让 Finder / Dock 读到真正的 app icon。
+- **[补本地验证]**: 已本地重打 `./scripts/build-cursor-motion-dmg.sh --configuration release --arch native --version 0.1.14-iconcheck`,并确认 `.app/Contents/Resources/` 内同时存在 `CursorMotion.icns` 和官方 cursor PNG。
+
+### 📁 Additional Files Modified
+- `docs/exec-plans/active/20260418-standalone-cursor-lab.md`
+- `scripts/build-cursor-motion-dmg.sh`
diff --git a/scripts/build-cursor-motion-dmg.sh b/scripts/build-cursor-motion-dmg.sh
index f735aff..0525bb2 100755
--- a/scripts/build-cursor-motion-dmg.sh
+++ b/scripts/build-cursor-motion-dmg.sh
@@ -108,6 +108,8 @@ build_binary() {
app_name="Cursor Motion.app"
bundle_identifier="com.ifuryst.cursormotion"
bundle_version="${CURSOR_MOTION_BUNDLE_VERSION:-${GITHUB_RUN_NUMBER:-$(git -C "${repo_root}" rev-list --count HEAD 2>/dev/null || echo 1)}}"
+bundle_icon_name="CursorMotion.icns"
+icon_render_script="${repo_root}/scripts/render-open-computer-use-icon.swift"
cursor_reference_source="${repo_root}/docs/references/codex-computer-use-reverse-engineering/assets/extracted-2026-04-19/official-software-cursor-window-252.png"
app_root="${output_dir}/${app_name}"
contents_dir="${app_root}/Contents"
@@ -115,6 +117,7 @@ macos_dir="${contents_dir}/MacOS"
resources_dir="${contents_dir}/Resources"
dmg_root="${output_dir}/dmg-root"
dmg_path="${output_dir}/CursorMotion-${version}.dmg"
+icon_work_dir=""
rm -rf "${output_dir}"
mkdir -p "${macos_dir}" "${resources_dir}" "${dmg_root}"
@@ -147,6 +150,24 @@ fi
cp "${cursor_reference_source}" "${resources_dir}/official-software-cursor-window-252.png"
+if [[ ! -f "${icon_render_script}" ]]; then
+ echo "Missing icon render script: ${icon_render_script}" >&2
+ exit 1
+fi
+
+cleanup() {
+ if [[ -n "${icon_work_dir:-}" ]]; then
+ rm -rf "${icon_work_dir}"
+ fi
+}
+trap cleanup EXIT
+
+icon_work_dir="$(mktemp -d "${TMPDIR:-/tmp}/cursor-motion-icon.XXXXXX")"
+iconset_dir="${icon_work_dir}/CursorMotion.iconset"
+mkdir -p "${iconset_dir}"
+swift "${icon_render_script}" "${iconset_dir}"
+iconutil -c icns "${iconset_dir}" -o "${resources_dir}/${bundle_icon_name}"
+
cat > "${contents_dir}/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">
@@ -156,6 +177,8 @@ cat > "${contents_dir}/Info.plist" <<PLIST
<string>en</string>
<key>CFBundleExecutable</key>
<string>CursorMotion</string>
+ <key>CFBundleIconFile</key>
+ <string>${bundle_icon_name}</string>
<key>CFBundleIdentifier</key>
<string>${bundle_identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>