Restore notifications data on Omarchy 4.0.3 scoped hosts - #10
Open
Macho0x wants to merge 1 commit into
Open
Conversation
4.0.3 capability-scopes plugin shell access: for a bar-widget the facade firstPartyServiceFor answers null, so the live count never moved, DND read as unsupported, the history list stayed empty, and Clear all returned early. Keep the service object first for hosts that hand it over, and fall back to the service stable on-disk state: history at ~/.local/state/omarchy/notifications/history, DND watched from ~/.local/state/omarchy/notifications.json and toggled through the host-level notifications IPC. Clear all goes through the same IPC on a scoped host. Version 1.3.1.
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.
Omarchy 4.0.3 compatibility: the first-party notifications service is unreachable
Omarchy 4.0.3 capability-scopes plugin shell access (
shell/services/PluginShellApi.qml). For a bar-widget the facade'sfirstPartyServiceFor()answers null (the service goes only to its owners), sonotificationServicewas null and — silently — the live count never moved, DND was reported unsupported, the history list stayed empty, and the Clear all button returned early.The host still runs the service itself; only the object reference is gated. Its state is reachable two ways, and both are stable first-party host constants (
notifications/Service.qml):~/.local/state/omarchy/notifications/history;historyDirnow falls back to that path when the service object is unavailable, so the existingbash/awkhistory reader and its 500 ms poll work unchanged{dnd}to~/.local/state/omarchy/notifications.jsonon every change; a watchedFileViewon that file now feedsdndOn(live, no polling), andtoggleDndfalls back to the host's ownnotificationsIPC target (omarchy-shell -q notifications toggleDnd) which is not capability-gatedclearAllno longer returns early on a scoped host: it falls back to the host IPC (dismissAll+clear) and clears local rows, so the button works again.Deliberately left as graceful degradation, with a code comment:
dismissPopup/removeHistoryEntryremain guarded and skipped (as they already were when the method was absent)The service-object path is kept first and unchanged for hosts that still hand it over (pre-4.0.3 shells), so nothing regresses there. Version bumped to 1.3.1.
Testing
omarchy restart shellcat ~/.local/state/omarchy/notifications.jsonshows"dnd": true; toggling from Omarchy's own indicators updates the icon live through the file watcher