Cloning a service + bar-widget plugin leaves the widget dead: firstPartyServiceFor() has no clonedFrom routing
What happened
omarchy plugin clone omarchy.media succeeds, enables the clone, and places it in the bar — but the cloned widget renders as a zero-width, invisible slot forever. There is no error, and the bar simply has a gap where the media widget was.
$ omarchy plugin clone omarchy.media
Cloned omarchy.media to /home/yander/.config/omarchy/plugins/yander.media and switched to yander.media
$ omarchy-shell shell debugBarGeometry | jq '.[] | select(.id | test("media"))'
{"id":"yander.media","section":"center","x":1016,"y":0,"width":0,"height":0,
"visible":false,"itemVisible":false,"itemWidth":0,"itemHeight":26}
This is not specific to the marquee or to media playback state — MPRIS was actively playing throughout.
Expected behavior
A cloned plugin should behave exactly like the built-in it replaced. omarchy plugin clone is the documented way to customize a built-in widget, and the clone script's own comment states the intent:
Keep built-in ids inside the plugin code as stable IPC targets. The shell uses
clonedFromto route those calls to this local manifest id.
Root cause
That routing exists — but it was never applied to service lookups.
omarchy.media is both a service and a bar-widget. Its BarWidget.qml reaches its own service by the built-in id:
// shell/plugins/services/media/BarWidget.qml:10
readonly property var mediaService: bar?.shell?.firstPartyServiceFor("omarchy.media")
Cloning writes omarchy.media into disabledPlugins, and _syncServices() only instantiates services for enabled plugins, destroying the rest:
// shell/shell.qml:333
if (!pluginRegistry.isEnabled(id)) continue
if (_services[id]) continue
ensureService(id)
So _services["omarchy.media"] is gone and the clone's service lives at _services["yander.media"]. But firstPartyServiceFor() is a plain dictionary lookup with no clonedFrom routing:
// shell/shell.qml:276-282
function serviceFor(pluginId) {
return _services[String(pluginId)] || null
}
function firstPartyServiceFor(pluginId) {
return serviceFor(pluginId)
}
Every other cross-plugin entry point does route through resolveEnabledId() first — shell.qml:442, 482, 499, 512, 569. Service lookup is the one path that was missed.
Result: mediaService is null → activePlayer is null → hasMedia is false → visible: hasMedia and implicitWidth: hasMedia ? … : 0 collapse the widget to nothing.
Confirmed at runtime with a temporary probe inside the cloned widget:
MEDIADIAG bar=y shell=y registry=y
resolveEnabledId=yander.media
serviceFor(rid)=OBJ
serviceFor(omarchy.media)=null <- what the widget actually asks for
serviceFor(yander.media)=OBJ <- where the service actually is
mediaService=OBJ activePlayer=OBJ hasMedia=true visible=true
(that probe already had the fix below applied, which is why the routed lookup resolves)
Scope
This affects any cloned plugin that is both a service and a bar-widget and looks up its own service by the built-in id — not just media. It is distinct from #7253 / #6971 / #6915, which are about bar-kind plugins failing to mount.
There is a second casualty: the built-in audio panel makes the same unrouted call, so its now-playing section goes blank while any media clone is active, even though the panel itself was never cloned:
// shell/plugins/panels/audio/Panel.qml:20
readonly property var mediaService: bar?.shell?.firstPartyServiceFor("omarchy.media")
Steps to reproduce
- Start any MPRIS source playing (Spotify, a browser tab) and confirm the media widget shows in the bar.
omarchy plugin clone omarchy.mediaomarchy restart shell- The media widget is gone from the bar.
omarchy-shell shell debugBarGeometryshows the entry present withwidth: 0, visible: false. - Open the audio panel — the now-playing section is blank too.
Suggested fix
Route the first-party lookup the same way the IPC paths already do, leaving the raw serviceFor() untouched:
function firstPartyServiceFor(pluginId) {
- return serviceFor(pluginId)
+ var id = pluginRegistry ? pluginRegistry.resolveEnabledId(pluginId) : pluginId
+ return serviceFor(id)
}
resolveEnabledId() already does exactly this mapping for IPC and returns the id unchanged when no clone is enabled, so built-in behavior is unaffected.
I could not patch shell.qml itself to test this, since /usr/share/omarchy is package-owned on an installed system. I verified the equivalent routing widget-side instead, in the clone — which exercises the same resolveEnabledId() → serviceFor() path:
readonly property var mediaService: {
var shellRef = bar?.shell
if (!shellRef) return null
var registry = shellRef.pluginRegistry
var serviceId = registry ? registry.resolveEnabledId("omarchy.media") : "omarchy.media"
return shellRef.serviceFor(serviceId)
}
With that in place the widget resolves its service, hasMedia becomes true, and it renders at full width (width: 207, visible: true). Doing it centrally in firstPartyServiceFor() would fix every cloned service consumer at once, including the audio panel above, which a widget-side workaround cannot reach.
One note for anyone reproducing: the fix needs omarchy restart shell to take effect. Plugin hot-reload does not rebuild an existing widget's property bindings, so editing a readonly property binding in place appears to do nothing (possibly related to #6981).
Environment: Omarchy 4.0.0-1, Hyprland 0.56.2, Quickshell 0.3.0, kernel 7.1.8-arch1-3, Intel i5-9400F / RTX 2060, single 1080p monitor.
Confirming this on 4.0.1-1, with a failure shape that widens the Scope section: the clone doesn't have to be a bar-widget, and the broken consumer doesn't have to be the clone.
Repro without cloning any widget
Clone the service-only omarchy.idle, and the Stay Awake button in the untouched built-in omarchy.indicators widget goes dead:
omarchy plugin clone omarchy.idle # -> kpowz.idle, omarchy.idle -> disabledPlugins
omarchy restart shell
// shell/plugins/bar/indicators/StayAwake.qml:7
readonly property var idleService: bar?.shell?.firstPartyServiceFor("omarchy.idle")
active: idleService ? idleService.stayAwake : false
function toggle() { if (root.idleService) root.idleService.setIdleEnabled(root.active) }
idleService is null, so active is pinned false — the indicator never enters its active state, only ever appears inactive-styled on hover-reveal, and clicking it there does nothing at all. No warning in the log.
The service itself is perfectly healthy the whole time, which makes this read as a bar bug rather than a routing one:
$ omarchy-shell idle disable
$ omarchy-shell idle status
{"enabled":false,"stayAwake":true,"stayAwakeStateLoaded":true,...} # state flips fine; the button never moves
That silence is arguably worse than the media case — there's no width-0 gap to notice, just a control that looks normal and is inert.
Why this widens the scope
omarchy.idle is not a bar-widget at all:
omarchy.idle ['service']
omarchy.nightlight ['service']
omarchy.notifications ['service']
omarchy.media ['service', 'bar-widget']
Three of the five unrouted firstPartyServiceFor() call sites point at service-only plugins, and all three of those live inside a widget the user never cloned:
bar/indicators/StayAwake.qml:7 -> omarchy.idle
bar/indicators/NightLight.qml:7 -> omarchy.nightlight
bar/indicators/Dnd.qml:8 -> omarchy.notifications
services/media/BarWidget.qml:10 -> omarchy.media
panels/audio/Panel.qml:20 -> omarchy.media
So the blast radius isn't "the clone renders wrong", it's "cloning any service silently disables an unrelated first-party control elsewhere in the shell" — same category as the audio-panel casualty you noted, but reachable without cloning a widget at all.
Confirms the suggested fix
Same constraint (can't patch package-owned shell.qml), so I verified the routing widget-side, inside a clone of omarchy.indicators:
readonly property var pluginRegistry: bar && bar.shell ? bar.shell.pluginRegistry : null
readonly property string idleServiceId: pluginRegistry ? pluginRegistry.resolveEnabledId("omarchy.idle") : "omarchy.idle"
readonly property var idleService: bar?.shell?.firstPartyServiceFor(root.idleServiceId)
Probe output across the injection sequence:
registry=no id=omarchy.idle service=no <- Component.onCompleted, before bar is injected
registry=yes id=omarchy.idle service=no
registry=yes id=kpowz.idle service=yes <- resolved
The button then tracks stayAwake and toggles correctly.
The widget-side workaround is a worse deal here than it is for media, which is another argument for fixing it centrally: reaching one indicator meant cloning omarchy.indicators wholesale, forking five unrelated indicators (Dictation, ScreenRecording, Reminder, NightLight, Dnd) out of upstream just to change one line in a sixth.
Also confirming the restart caveat
With an extra wrinkle for QML under a cloned plugin's subdirectory (indicators/*.qml): hot-reload re-instantiates the cached old component. The log prints Local plugin changed, reloading: kpowz.indicators while a console.log added seconds earlier still emits the previous string. omarchy restart shell is required — a hot reload will quietly test stale code.
Environment: Omarchy 4.0.1-1, Hyprland 0.56.2, Quickshell 0.3.1, kernel 7.1.9-arch1-2, Intel i7-1185G7 / Iris Xe, single eDP-1 1920x1080 @ 1.6.
Confirmed this also affects a service-only clone consumed by a separate built-in widget.
On Omarchy 4.0.1-1:
omarchy plugin clone omarchy.idle- Restart the shell.
- The top-bar Stay Awake indicator becomes inert.
plugins/bar/indicators/StayAwake.qml calls:
bar?.shell?.firstPartyServiceFor("omarchy.idle")
The built-in service is disabled and the active service is stored as claudio.idle, so this returns null; the click handler silently does nothing. The idle IPC itself remains healthy.
Verified the same workaround described here by cloning omarchy.indicators and routing the lookup through pluginRegistry.resolveEnabledId("omarchy.idle") before serviceFor(). The button then toggles and persists Stay Awake normally. This is another concrete reason the central firstPartyServiceFor() fix in #7587 is preferable to widget-side workarounds.
Confirming this is still present on 4.0.4-1. Repro: omarchy plugin clone omarchy.media — the resulting widget's own bar?.shell?.firstPartyServiceFor("omarchy.media") call returns null even though the underlying service (verified via its IPC status handler) reports hasMedia: true the whole time. Widget's implicitWidth collapses to 0 and it disappears from the bar entirely, with no warning in quickshell log. Happened both with an untouched, byte-for-byte clone and with the widget hosted under a cloned bar plugin, so it lines up with the routing bug described here rather than anything bar-specific. Had to omarchy plugin remove the clone to get the widget back.
This is fixed on quattro but not yet in a release, so it is waiting on a maintainer, who can close it now or when the next release ships.
The fix is 203e1639 ("Revoke stale plugin facade capabilities"), merged with #9618. It routes service lookups through resolveEnabledId(), so a source id like omarchy.media now reaches an enabled clone's service. That covers both paths this issue and its comments describe:
- A clone's own widget (the media
BarWidget.qmlinsideyander.media) gets a scoped shell, whosefirstPartyServiceFor()treats the source id as the clone's own and resolves it to the clone (shell/shell.qml:384-392,608-610). - First-party consumers of a cloned service, which are the audio panel's now-playing section and the Stay Awake, Night Light and Do Not Disturb indicators, get the real shell, whose
firstPartyServiceFor()now resolves the id the same way (shell/shell.qml:884-886).
No release tag contains that commit; v4.0.4 is the latest, which is why it still reproduced there.
Checked on a clean Omarchy worker VM, running quattro at b83d3df0. test/shell.d/runtime-smoke-test.sh builds a service + bar-widget clone with clonedFrom: "omarchy.media" whose widget calls firstPartyServiceFor("omarchy.media"), the call from this report. It passed 4 runs of 5. The fifth run timed out waiting for bar geometry before reaching the clone checks. plugin-auth-boundary-test.sh passed. With the routing in shell/shell.qml reverted to plain lookups, the clone check fails: "a cloned widget resolves its source id to its own companion service". So the test catches exactly this bug.
Codex Medium gave a second opinion by reading the same tree. It traced all five callers named here to the clone's service through those two paths and found no remaining broken path. It agreed with the reading above, and its independence is not guaranteed.
Another concrete case on 4.5.0-3: omarchy plugin clone omarchy.indicators produces a partly dead widget. The cloned NightLight, Dnd and StayAwake indicators call bar.shell.firstPartyServiceFor("omarchy.nightlight" / "omarchy.notifications" / "omarchy.idle"), which returns null for a bar-widget clone (only plugins of kind bar get these services, see hasCurrentBarCapabilities() in shell.qml). Result: clicking them does nothing, and they never show their active state. The other indicators (Reminder, ScreenRecording, PasswordlessSudo) still work because they only run commands.
Workaround in the clone: read and toggle state via IPC (omarchy-shell idle status|enable|disable, omarchy-shell nightlight status|toggle, omarchy-shell notifications isDnd|toggleDnd) with a short poll.
The November 7 report about cloning omarchy.indicators is still explained by current quattro (c6be7abb9). The clone keeps kinds: ["bar-widget"], while its scoped shell builds cross-plugin service proxies only for plugins with kind bar (shell/shell.qml:633-655). Night Light, Do Not Disturb and Stay Awake therefore get null and their click handlers do nothing. Remote Session is affected by the same gate. This is a separate failure from the original source-ID routing, which remains fixed.
#17821 addresses this remaining case under the built-in bar: it gives an indicators clone narrow proxies for those four services. It preserves the existing own-service lookup and trusted consumers of cloned services. It leaves replacement-bar hosting unchanged; those entries still receive a service-less interface.
Codex High checked the current source and the PR diff. Opus 5.5 High and muse-wonder via pi, thinking high gave second opinions and agreed; their independence is not guaranteed. Both also identified the limit of the PR's test: it checks that proxy objects exist, without exercising the nested indicators' state changes or clicks. This run used source inspection only; no worker reproduction or tests were run.
I tried to add a closing link from #17821, but the checked command refused because that PR has not yet been classified as a fix. No closing link was added. This issue remains open while #17821 receives its own review and the maintainer decides what to take.