Fix dead widget when omarchy.notifications has been cloned - #9
Open
pabg92 wants to merge 1 commit into
Open
Conversation
firstPartyServiceFor() is a raw lookup into the shell's _services map, and _syncServices() only registers a plugin under the id it is enabled under. After `omarchy plugin clone omarchy.notifications` the clone is enabled as <user>.<name> and the built-in is disabled, so the lookup returns null and the widget goes dead: no live count, no history dir, and DND reports as unsupported so the toggle does nothing. PluginRegistry.resolveEnabledId() exists for this - it maps a built-in id to whichever enabled manifest declares omarchy.clonedFrom for it, and returns the id unchanged when nothing was cloned. Resolve through it first and fall back to the literal id when the host has no registry.
pabg92
force-pushed
the
fix/resolve-cloned-notification-service
branch
from
August 27, 2026 18:09
740dc53 to
f63e41e
Compare
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.
What
Resolve the notification service id through
pluginRegistry.resolveEnabledId()beforehanding it to
firstPartyServiceFor(), instead of always asking for the literal"omarchy.notifications".Why
firstPartyServiceFor()is not a resolving lookup. In/usr/share/omarchy/shell/shell.qml(lines 275-281) it is just:
a raw dictionary read. And
_syncServices()in the same file (~lines 325-340) onlyinstantiates services for plugins that are enabled, storing each one under its own
id (
snext[key] = instinensureService).omarchy plugin clone omarchy.notificationscopies the built-in to<user>.<name>,records
omarchy.clonedFromin the clone's manifest, enables the clone and disables theoriginal. So after a clone there is no
_services["omarchy.notifications"]at all - theservice is registered under the clone's id.
The registry already has the answer:
/usr/share/omarchy/shell/services/PluginRegistry.qmllines 146-157,
resolveEnabledId(id), whose own comment says "Callers keep using thebuilt-in id after cloning; the enabled local manifest is the implementation that should
receive the call." It walks
installedPluginsfor an enabled manifest whoseomarchy.clonedFrommatches, and returns the requested id unchanged otherwise.Who it affects
Anyone who has run
omarchy plugin clone omarchy.notificationsto customise thenotification service - a documented, first-class Omarchy workflow.
For them
notificationServiceis null, so the widget silently degrades to an emptyshell:
liveCountstays 0,historyDiris""so no history rows are ever read,dndSupportedis false so the DND toggle is inert, and the icon never leaves itsidle glyph. Nothing is logged and no error is shown - it just looks like nothing
ever arrives.
Compatibility
Nothing changes for anyone who has not cloned:
resolveEnabledIdreturns the idunchanged, so the lookup is identical to today's. The binding also falls back to the
literal
"omarchy.notifications"when the host exposes nopluginRegistryor noresolveEnabledId, so older shells behave exactly as before.It stays a
readonly propertybinding rather than a one-shot function call, so itre-evaluates when the registry populates or when a plugin is enabled/disabled at
runtime.
Found and verified on a real Omarchy 4.0.0 system (package 4.0.0-1), where the widget was dead until
this change.