Skip to content

fix(sketchybar): drop the aerospace leftovers and the stale brew service label - #165

Merged
gapul merged 2 commits into
mainfrom
fix-aerospace-leftovers
Aug 8, 2026
Merged

fix(sketchybar): drop the aerospace leftovers and the stale brew service label#165
gapul merged 2 commits into
mainfrom
fix-aerospace-leftovers

Conversation

@gapul

@gapul gapul commented Aug 8, 2026

Copy link
Copy Markdown
Owner

sketchybar を launchd 化した後の起動確認で、aerospace の残骸が動いているのを見つけたので掃除した。

実害があったもの

helpers/wm.sh は OmniWM が動いていなければ /opt/homebrew/bin/aerospace にフォールバックする作りだった。aerospace は #125 で撤去済みでバイナリは存在しないので、この経路に入ると全照会が空を返す。エラーにもならず、バーが黙って無表示になるだけ。フォールバック分岐ごと落とした。

helpers/refresh-displays.sh は最初から最後まで aerospace 依存で、ディスプレイを抜き差ししたあとに叩く手動コマンドがそもそも動かない状態だった。wm.sh 経由に付け替えた(wm_list_monitors_by_x を追加。display_watch.sh に同じロジックが埋まっていたのでそこも共有させた)。

#161 が置いていったもの

just restart sketchybar と app_guard の再起動コマンドが homebrew.mxcl.sketchybar を指したままだった。launchd 化でこのラベルは消えたので org.nix-community.home.sketchybar に直した。自分の PR の後始末。

ついでに

Puddle が黙って起動していなかった(プロセスなし・クラッシュログなし、ただ落ちていただけ)。app_guard の監視対象はまさにこういうやつのためにあるので追加した。

残したもの

イベント名 aerospace_workspace_changeAEROSPACE_* 環境変数、/tmp/sketchybar-aero-display.map。発火側の omniwm-event.sh と受け側で名前が一貫していて、改名しても挙動は1ミリも変わらず、読み書き両側を触る差分だけが増える。気持ち悪いのは分かるが今回は見送った。

検証

  • bash -n 3ファイル、just fmt(shellcheck 含む)Pass
  • wm.sh の関数を実機で実行: wm_list_monitors_by_x → 1、wm_focused_workspace → 4、wm_workspace_apps → Google Chrome
  • refresh-displays.sh を実走。マップ生成(1:1)、launchctl kickstart での再起動、再起動後も sketchybar が生存しているところまで確認

gapul added 2 commits August 8, 2026 18:26
…ice label

aerospace was removed in #125 but the sketchybar helpers still called
/opt/homebrew/bin/aerospace. wm.sh fell back to that binary whenever OmniWM was
not running, so instead of failing it quietly returned nothing and the bar went
blank; refresh-displays.sh depended on it outright and could not work at all.

Also two labels that #161 invalidated: `just restart sketchybar` and
app_guard's restart command still pointed at homebrew.mxcl.sketchybar, which no
longer exists now that the agent is org.nix-community.home.sketchybar.

Puddle is added to the app_guard list — it had silently not been running, which
is exactly what that list is for.

Kept as-is: the aerospace_workspace_change event name, the AEROSPACE_* env vars
and /tmp/sketchybar-aero-display.map. They are consistent between the firing
side and the reading side, so renaming changes no behaviour and only widens the
diff.
Event aerospace_workspace_change -> omniwm_workspace_change, AEROSPACE_* ->
OMNIWM_*, /tmp/sketchybar-aero-display.map -> sketchybar-omniwm-display.map.
Both the firing side (omniwm-event.sh) and every reading side are renamed in
the same commit; a half rename would leave the event reaching nobody.
@gapul
gapul merged commit 88d3308 into main Aug 8, 2026
3 checks passed
@gapul
gapul deleted the fix-aerospace-leftovers branch August 8, 2026 10:06
gapul added a commit that referenced this pull request Aug 8, 2026
#165's rename touched the same comment block that this branch deletes; keeping
the deletion.
gapul added a commit that referenced this pull request Aug 8, 2026
Takes main's shape for the CustomUserPreferences block and the sketchybar agent
(both reworked by #162/#165 after this branch forked); keeps the nix-homebrew
block and drops the old postActivation that #162 replaced.
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