fix(omarchy): wait for the shell to list the widget before enabling #554

Merged
enricobuehler merged 1 commits from fix/omarchy-plugin-enable-wait into main 2026-09-02 13:43:05 +00:00
Owner

A fresh Omarchy install (punktfunk-setuppunktfunk-omarchy setup) left the bar widget on disk but not in the bar. Reported on omarchy-1 today, 0.35.0 canary, script byte-identical to main.

Root cause

setup_plugin copies the plugin into ~/.config/omarchy/plugins/punktfunk and calls omarchy plugin enable punktfunk in the same instant. The shell's PluginRegistry learns of a new directory through an inotify watch and an asynchronous bash rescan, so at that moment the id is unknown:

omarchy-plugin-enable: plugin 'punktfunk' is not known; run: omarchy-shell shell rescanPlugins

Setup caught the non-zero exit and printed a yellow "could not enable it automatically" under a green "widget installed", so the installer reported success. Running punktfunk-omarchy setup a second time worked because the files already existed.

Fix

Same wait as omarchy-plugin-add: omarchy shell shell rescanPlugins, then poll omarchy plugin list for up to 2 s (40 × 50 ms) before enabling. The manifest also gets "defaultSection": "right": without it Omarchy places a bar widget in the center, between weather and system-update.

Measured on omarchy-1 (Omarchy 4.0.0.alpha, 192.168.1.6)

Sequence Result
copy, then enable at once (old) not known, exit 1
same enable 3 s later Enabled
patched setup_plugin from a clean state, first try Enabled in 0.37 s
new manifest, disable + enable widget in right, after tray

Clean state for the reproduction: omarchy plugin disable punktfunk; rm -rf ~/.config/omarchy/plugins/punktfunk. Shell log shows no punktfunk warnings after either run.

Not done

  • No retry on enable itself: once the id is listed, enable succeeded every time.
  • The warn path stays for a box with no running shell (setup from a TTY or ssh before first login); the message already names the command to run.
  • No changelog entry: 0.35.0 has no section yet and this is packaging, not ABI.

Checks: bash packaging/linux/omarchy/selftest.sh passes with a new stub-based check that plugin_known keeps polling; WRITING_BASE=origin/main scripts/ci/check-writing.sh passes.

A fresh Omarchy install (`punktfunk-setup` → `punktfunk-omarchy setup`) left the bar widget on disk but not in the bar. Reported on omarchy-1 today, 0.35.0 canary, script byte-identical to main. ## Root cause `setup_plugin` copies the plugin into `~/.config/omarchy/plugins/punktfunk` and calls `omarchy plugin enable punktfunk` in the same instant. The shell's `PluginRegistry` learns of a new directory through an inotify watch and an asynchronous bash rescan, so at that moment the id is unknown: ``` omarchy-plugin-enable: plugin 'punktfunk' is not known; run: omarchy-shell shell rescanPlugins ``` Setup caught the non-zero exit and printed a yellow "could not enable it automatically" under a green "widget installed", so the installer reported success. Running `punktfunk-omarchy setup` a second time worked because the files already existed. ## Fix Same wait as `omarchy-plugin-add`: `omarchy shell shell rescanPlugins`, then poll `omarchy plugin list` for up to 2 s (40 × 50 ms) before enabling. The manifest also gets `"defaultSection": "right"`: without it Omarchy places a bar widget in the center, between weather and system-update. ## Measured on omarchy-1 (Omarchy 4.0.0.alpha, 192.168.1.6) | Sequence | Result | | --- | --- | | copy, then enable at once (old) | not known, exit 1 | | same enable 3 s later | Enabled | | patched `setup_plugin` from a clean state, first try | Enabled in 0.37 s | | new manifest, disable + enable | widget in `right`, after tray | Clean state for the reproduction: `omarchy plugin disable punktfunk; rm -rf ~/.config/omarchy/plugins/punktfunk`. Shell log shows no punktfunk warnings after either run. ## Not done - No retry on `enable` itself: once the id is listed, enable succeeded every time. - The warn path stays for a box with no running shell (setup from a TTY or ssh before first login); the message already names the command to run. - No changelog entry: 0.35.0 has no section yet and this is packaging, not ABI. Checks: `bash packaging/linux/omarchy/selftest.sh` passes with a new stub-based check that `plugin_known` keeps polling; `WRITING_BASE=origin/main scripts/ci/check-writing.sh` passes.
enricobuehler added 1 commit 2026-09-02 13:24:02 +00:00
fix(omarchy): wait for the shell to list the widget before enabling
ci / docs-site (pull_request) Successful in 1m17s
ci / bun-nix (pull_request) Successful in 22s
ci / docs-drift (pull_request) Successful in 31s
ci / rust-arm64 (pull_request) Successful in 5m48s
ci / web (pull_request) Successful in 5m33s
secret-scan / gitleaks (pull_request) Successful in 16s
installer-smoke / omarchy integration self-check (pull_request) Successful in 1m5s
installer-smoke / build punktfunk-setup (musl) (pull_request) Failing after 7m46s
installer-smoke / omarchy (armed update guard) (pull_request) Skipped
installer-smoke / smoke (arch) (pull_request) Skipped
installer-smoke / smoke (debian-13) (pull_request) Skipped
installer-smoke / smoke (fedora-44) (pull_request) Skipped
ci / rust (pull_request) Successful in 38m13s
89de08c82a
Setup copied the plugin files and called `omarchy plugin enable` in the
same instant. The shell learns of a new plugin directory through inotify
and an asynchronous rescan, so the id was still unknown, enable exited 1,
and setup downgraded that to a warning under a green "installed" line.
Every fresh install ended with the widget on disk and absent from the bar.

The wait is the one omarchy-plugin-add uses: ask for a rescan, then poll
the plugin list for up to two seconds before enabling. On omarchy-1 the
old sequence fails at 0 s and succeeds at 3 s; the new one enables on the
first try in 0.4 s.

The manifest now names `right` as its section. Without it Omarchy puts a
bar widget in the center, between weather and system-update, away from
the network and audio widgets it belongs beside.
enricobuehler merged commit 3baa492a5e into main 2026-09-02 13:43:05 +00:00
enricobuehler deleted branch fix/omarchy-plugin-enable-wait 2026-09-02 13:43:06 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unom/punktfunk#554