Skip to content

fix: start AeroSpace and request SketchyBar permissions after setup - #158

Merged
CollieIsCute merged 2 commits into
masterfrom
fix/sketchybar-first-launch
Sep 14, 2026
Merged

CollieIsCute merged 2 commits into
masterfrom
fix/sketchybar-first-launch

Conversation

@CollieIsCute

@CollieIsCute CollieIsCute commented Sep 14, 2026

Copy link
Copy Markdown
Owner

變更

  • macOS 安裝流程末尾以 run_once_after_9-start-aerospace.sh 開啟 AeroSpace,交由上游請求輔助使用權限並啟動 SketchyBar;CI 不啟動 GUI。
  • 在列出原生圖示之前執行 sketchybar --query default_menu_items,使用上游內建的螢幕錄製授權請求,避免因權限不足跳過 alias 後連提示都不出現。
  • README 更新首次授權、拒絕後手動開啟,以及「關閉 SketchyBar,再關閉並重開 AeroSpace」的操作。

沒有新增依賴、授權 helper、常駐服務或功能測試腳本。沒有更動 SIP、TCC、既有 UI、workflow 或 -vsketchybar-plan.html 只更新本機,未追蹤或推送。

驗證

  • git diff --check、SketchyBar 設定及渲染後 hook 的 sh -n
  • 模板在 Linux/Windows 輸出為空;macOS 的 CI=true 路徑不執行 open
  • 經 chezmoi 實際套用設定與首次啟動 hook;第二次 dry-run 沒有再次執行 hook。
  • 已授權現機 reload 正常;原生 menu 查詢回傳非空 JSON,12 個元件外觀屬性與修改前一致。
  • 未授權新機:首次提示、允許/拒絕、授權後完整重啟,仍待該環境實際驗收。本次未重設現機權限,不將已授權測試當成此項通過。
  • 四平台安裝 CI:c0dfa8efdefd374521c1d7e0208143f150f0a028 的 macOS/Arch/Ubuntu 已通過;Windows 三輪皆在下載階段失敗,尚未全綠。

Windows 第一次下載 KeePassXC 2.7.12 收到 HTTP 504;第二次回報 error retrieving GitHub release latest;第三次取得 chezmoi 2.72.2 版本後,DownloadString 再次收到 HTTP 504。後兩次尚未執行 dotfiles。已單獨重跑兩次,停止連續重試,待下載服務恢復後再驗證;未修改 Windows 安裝程式、套件或略過安裝。

可重跑的 CI 分支檢查(macOS,不啟動 GUI):

trace=$(chezmoi execute-template -f home/.chezmoiscripts/run_once_after_9-start-aerospace.sh.tmpl | CI=true sh -x 2>&1)
case "$trace" in *'/usr/bin/open'*) exit 1 ;; esac

範圍界線

這個 MR 只補首次啟動與授權入口,不宣稱完整的新機零設定安裝。原生選單列自動隱藏仍依 README 手動設定;Homebrew 初次初始化的 PATH、separate-Spaces 設定衝突與原生 App 的 3 秒啟動等待不在這次修改範圍。

依據:SketchyBar 2.24.0 的原生授權請求AeroSpace 的授權及啟動順序

@CollieIsCute
CollieIsCute merged commit 77a532a into master Sep 14, 2026
0 of 4 checks passed
@CollieIsCute
CollieIsCute deleted the fix/sketchybar-first-launch branch September 14, 2026 15:51
CollieIsCute added a commit that referenced this pull request Sep 14, 2026
…158)

## 變更

- macOS 安裝流程末尾以 `run_once_after_9-start-aerospace.sh` 開啟
AeroSpace,交由上游請求輔助使用權限並啟動 SketchyBar;CI 不啟動 GUI。
- 在列出原生圖示之前執行 `sketchybar --query
default_menu_items`,使用上游內建的螢幕錄製授權請求,避免因權限不足跳過 alias 後連提示都不出現。
- README 更新首次授權、拒絕後手動開啟,以及「關閉 SketchyBar,再關閉並重開 AeroSpace」的操作。

沒有新增依賴、授權 helper、常駐服務或功能測試腳本。沒有更動 SIP、TCC、既有 UI、workflow 或
`-v`。`sketchybar-plan.html` 只更新本機,未追蹤或推送。

## 驗證

- [x] `git diff --check`、SketchyBar 設定及渲染後 hook 的 `sh -n`。
- [x] 模板在 Linux/Windows 輸出為空;macOS 的 `CI=true` 路徑不執行 `open`。
- [x] 經 chezmoi 實際套用設定與首次啟動 hook;第二次 dry-run 沒有再次執行 hook。
- [x] 已授權現機 reload 正常;原生 menu 查詢回傳非空 JSON,12 個元件外觀屬性與修改前一致。
- [ ] 未授權新機:首次提示、允許/拒絕、授權後完整重啟,仍待該環境實際驗收。本次未重設現機權限,不將已授權測試當成此項通過。
- [ ] 四平台安裝 CI:`c0dfa8efdefd374521c1d7e0208143f150f0a028` 的
macOS/Arch/Ubuntu 已通過;[Windows
三輪皆在下載階段失敗](https://github.com/CollieIsCute/dotfiles/actions/runs/34857855261),尚未全綠。

Windows 第一次下載 KeePassXC 2.7.12 收到 HTTP 504;第二次回報 `error retrieving
GitHub release latest`;第三次取得 chezmoi 2.72.2 版本後,`DownloadString` 再次收到
HTTP 504。後兩次尚未執行 dotfiles。已單獨重跑兩次,停止連續重試,待下載服務恢復後再驗證;未修改 Windows
安裝程式、套件或略過安裝。

可重跑的 CI 分支檢查(macOS,不啟動 GUI):

```sh
trace=$(chezmoi execute-template -f home/.chezmoiscripts/run_once_after_9-start-aerospace.sh.tmpl | CI=true sh -x 2>&1)
case "$trace" in *'/usr/bin/open'*) exit 1 ;; esac
```

## 範圍界線

這個 MR 只補首次啟動與授權入口,不宣稱完整的新機零設定安裝。原生選單列自動隱藏仍依 README 手動設定;Homebrew 初次初始化的
PATH、separate-Spaces 設定衝突與原生 App 的 3 秒啟動等待不在這次修改範圍。

依據:[SketchyBar 2.24.0
的原生授權請求](https://github.com/FelixKratz/SketchyBar/blob/v2.24.0/src/alias.c#L125)、[AeroSpace
的授權及啟動順序](https://github.com/nikitabobko/AeroSpace/blob/v0.21.3-Beta/Sources/AppBundle/initAppBundle.swift#L9)。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant