Update icon appears on only one monitor: concurrent omarchy-update-available runs race inside checkupdates
What happens
With more than one bar (one per monitor), the pending-update icon shows up on some monitors and not others, and stays that way for up to six hours.
Why
SystemUpdate.qml is instantiated once per bar, and each instance runs omarchy-update-available from its own Timer with triggeredOnStart: true, so every monitor starts one at the same instant. omarchy-update-available calls checkupdates, which shares one temporary database per user (${TMPDIR}/checkup-db-${UID}/) guarded by db.lck. When two runs overlap, the loser prints ==> ERROR: Cannot fetch updates and exits 1. The widget maps that exit code straight to updateAvailable = false, so that monitor's bar hides the icon until the next six-hour check.
Reproduce
$ (omarchy-update-available; echo "A=$?") & (omarchy-update-available; echo "B=$?") & wait
omarchy-dev 4.0.0.r2138.gf2b419d-1 -> 4.0.0.r2147.g2fbac0c-1
B=0
Omarchy is up to date
A=1
Run alone, it always reports the update. Two monitors, two bars, same result in the UI: the icon appears on one bar only.
Environment
omarchy-dev 4.0.0.r2138.gf2b419d-1, quickshell 0.3.1-1, three monitors (two with a bar).
Possible fixes
- Serialize the script with
flockand cache the result briefly, so all bars see the same answer (what I am running locally). - Or have a single instance own the check and broadcast the result, since
broadcastalready exists forrefresh/clear. - Either way,
checkupdatesfailing should probably not be indistinguishable from "no updates".
Happy to send a PR for whichever you prefer.
Follow-up: the flock workaround above is not enough, and I have measured why.
Serializing omarchy-update-available only serializes its own copies. The shared database belongs to checkupdates itself — ${TMPDIR:-/tmp}/checkup-db-${UID} — and every caller on the machine uses it, each deleting that database's db.lck as it exits. So any other checkupdates collides just as well:
$ checkupdates & checkupdates
one returns 146 lines, the other exits 1 with "==> ERROR: Cannot fetch updates"
On this machine the other caller is a third-party updates widget in the tray that refreshes on its own 30-minute schedule; a plain checkupdates in a terminal does it too. With the lock in place I still had no icon today, with omarchy-dev itself pending — the widget's startup check had lost that race and the six-hour interval kept the icon hidden.
checkupdates supports CHECKUPDATES_DB, so the fix is one line in omarchy-update-available:
export CHECKUPDATES_DB="${XDG_RUNTIME_DIR:-/tmp}/omarchy-checkup-db-$UID"
Measured with it: a private-database run and a shared-database run in parallel both return 146 lines, and three cold-database runs found the update 3/3. Running here since this morning; the icon now appears at shell startup.
This also makes the third bullet in the issue cheaper to act on: with a database of its own, a checkupdates failure is a real failure (no network, corrupt db) rather than routine contention, so treating it as distinct from "no updates" stops being a judgement call.
Still happy to send the PR — the one-liner alone, or together with the flock + short cache, which is still worth having for the per-monitor case.
I read this against quattro at 9480d1b6a. Nothing was run. The race you describe is still there, and it is the same bug as #11077, which was opened earlier and is still open: every bar runs omarchy-update-available from its own triggeredOnStart timer (shell/plugins/bar/widgets/SystemUpdate.qml:51), the script calls checkupdates with no lock and throws away its failure (bin/omarchy-update-available:31), and the widget treats exit 1 as "no update" (SystemUpdate.qml:43). Same symptom, same cause, same branch, so I am closing this as a duplicate of #11077. The fix for that issue is #11480.
Your follow-up adds something #11077 does not have, so here it is for whoever decides on #11480. That pull request puts a per-user flock around checkupdates inside omarchy-update-available. That stops two bars racing each other, which is what this issue's title describes. It does not stop any other checkupdates run under your user from colliding. With CHECKUPDATES_DB unset, every run uses ${TMPDIR:-/tmp}/checkup-db-$UID, and on exit its trap deletes that database's db.lck whether or not it took the lock (/usr/bin/checkupdates:132-136 in pacman-contrib 1.13.1). That covers the tray widget and terminal runs you measured. A private CHECKUPDATES_DB keeps those other callers out. Omarchy's own bars still share that private database, though, so on its own it does not replace the lock. Either the lock or the private database alone leaves one of the two collisions open.
Claude Opus 5.5 did the diagnosis. Codex Medium, asked separately, agreed these are the same bug and that this should close in favour of #11077, and confirmed the checkupdates source. It added the point that a private database still needs the lock. Its independence from this review is not guaranteed.
If I have read this wrong and it is a different bug, it can be reopened. What happens next is up to the maintainer, through #11480.