chore: own sketchybar's launchd agent, mirror two app-written configs - #161
Merged
Conversation
sketchybar's formula was declared but nothing started it — the bar only ran because `brew services start` had been typed on this machine once, so a fresh mac came up with no bar. Own the daemon like borders does, and stop the brew service on activation. OmniWM's settings.toml and CodexBar's config.json are rewritten by the apps themselves, so home.file would break them. Track them as one-way mirrors (`just app-snapshot`), same contract as obsidian-snapshot.
gapul
added a commit
that referenced
this pull request
Aug 8, 2026
The squash-merge of #161 made git see the same agent arriving from both sides, so darwin-chrome.nix ended up with two launchd.agents.sketchybar blocks (a duplicate-attribute error) and borders was reverted to exec'ing the $HOME path instead of the store one.
gapul
added a commit
that referenced
this pull request
Aug 8, 2026
* chore: own sketchybar's launchd agent, mirror two app-written configs sketchybar's formula was declared but nothing started it — the bar only ran because `brew services start` had been typed on this machine once, so a fresh mac came up with no bar. Own the daemon like borders does, and stop the brew service on activation. OmniWM's settings.toml and CodexBar's config.json are rewritten by the apps themselves, so home.file would break them. Track them as one-way mirrors (`just app-snapshot`), same contract as obsidian-snapshot. * refactor(nix): replace the scripted bits with declared ones - Skim/Puddle prefs and the security-update defaults move from hand-rolled `defaults write` loops to system.defaults.CustomUserPreferences / CustomSystemPreferences, which is the same write, declared. - nix.custom.conf stops being five append-if-grep-misses blocks and becomes one regenerated marked block, so a rotated cache key replaces the old line instead of stacking on top of it. - borders/theme-watch move into the store, so the running agent belongs to a generation instead of to whatever is on disk. - The four one-shot legacy-plist migrations become one dated list. - The three restic scripts, duplicated across the darwin and linux modules, move into lib/restic-common.nix; the modules keep only launchd vs systemd. - The launchd agent helper, copy-pasted in maintenance and restic, moves to lib. - `nh home switch` gets -b hm-bak so a newly declared home.file whose target already exists actually gets linked. - Login item registration reports failures instead of swallowing them, and the redundant brew trust pass is dropped from rebuild (upgrade still needs it). * docs: regenerate for app-snapshot * fix: drop the sketchybar agent duplicated by the merge The squash-merge of #161 made git see the same agent arriving from both sides, so darwin-chrome.nix ended up with two launchd.agents.sketchybar blocks (a duplicate-attribute error) and borders was reverted to exec'ing the $HOME path instead of the store one.
gapul
added a commit
that referenced
this pull request
Aug 8, 2026
…ice label (#165) * fix(sketchybar): drop the aerospace leftovers and the stale brew service 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. * refactor(sketchybar): rename the aerospace-era identifiers to omniwm 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
added a commit
that referenced
this pull request
Aug 8, 2026
* fix(sketchybar): drop the aerospace leftovers and the stale brew service 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. * refactor(sketchybar): rename the aerospace-era identifiers to omniwm 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. * chore(wallpaper): drop the HTML/JS wallpapers, keep only Metal Puddle renders the .metal shaders natively — lsof shows it holding globe.metal open with the Metal shader caches, and it sits at ~1% CPU, which an HTML canvas polling state.js every 300ms would not. The six .html files and system-theme.js were left over from the WebView era and nothing reads them. With them go the state.js writer in omniwm-event.sh (a gitignored file inside the repo that the WM rewrote on every workspace switch) and its .gitignore entry. Workspace linkage now runs solely through the inputs files that the Metal contract reads. Puddle's own websites list still holds four file:// entries pointing at the deleted HTML. They are app-side state, not rendered, and harmless; clear them from Puddle's settings when convenient.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#160 の続き。実機にあって宣言されていなかったものを片付ける。
sketchybar を launchd に載せた
formula は宣言されていたけど、起動しているのは
brew services start sketchybarを一度手で叩いて作られたhomebrew.mxcl.sketchybar.plistだった。リポジトリのどこにも書かれていないので、まっさらな mac を rebuild してもバーが出ない状態だった。兄弟の borders は既にlaunchd.agents.bordersで宣言済みなので、そこに揃えた。launchd.agents.sketchybarを darwin-chrome.nix に追加。PATH と LANG は brew の plist が持っていたものをそのまま移した(launchd は PATH が空で起動するので、sketchybarrc から呼ぶ media-control や displayplacer が解決できなくなる)home.activation.sketchybarBrewServiceで brew service を停止して plist を削除。2回目以降は no-opOmniWM と CodexBar の設定をミラーで追跡
どちらも
home.fileにはできない。アプリ自身が書き戻すファイルで、store の読み取り専用シンボリックリンクにすると設定を保存できなくなる。実際 settings.toml はキーがソート済み、float がフル精度 (0.979300037944676)、バージョン間でキーが増減していて、明らかにアプリの出力だった。なので obsidian-snapshot と同じ片方向ミラー方式にした。
configs/wm/omniwm/settings.tomlとconfigs/apps/codexbar/config.jsonを追加、それぞれ README 付きjust app-snapshotでライブ → リポジトリの一方通行。差分がなければ何もしないproviders[].codexActiveSource(Codex アカウントの UUID)はスナップショット時にjqで落としている検証
nix build .#homeConfigurations.gapul.activationPackage成功。生成されたorg.nix-community.home.sketchybar.plistを plutil で確認(ProgramArguments / PATH / KeepAlive とも意図どおり)just app-snapshotを2通り実走。差分なしの経路と、わざとリポジトリ側を書き換えた差分ありの経路の両方just fmt(deadnix / gitleaks / nixfmt / shellcheck) 全部 Pass別件、要確認
~/.config/gh-dash/config.ymlと~/.config/slk/config.tomlが、#153 で宣言済みなのに実機ではリンクされず素のファイルのままだった。現行世代の home-manager-files には両方入っているのに、8/8 12:50 の activation で張られた 61 本のリンクに含まれていない。.hm-bakも残っていない。中身はリポジトリ側と完全に一致しているので実害はないけど、宣言が黙って効いていないのは気持ち悪い。ライブ側を退避すれば次の rebuild で張られるはずなので、必要なら別途。