Skip to content

Restore notifications data on Omarchy 4.0.3 scoped hosts - #10

Open
Macho0x wants to merge 1 commit into
Shavanced:mainfrom
Macho0x:fix/omarchy-4.0.3-data-seam
Open

Restore notifications data on Omarchy 4.0.3 scoped hosts#10
Macho0x wants to merge 1 commit into
Shavanced:mainfrom
Macho0x:fix/omarchy-4.0.3-data-seam

Conversation

@Macho0x

@Macho0x Macho0x commented Sep 10, 2026

Copy link
Copy Markdown

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's firstPartyServiceFor() answers null (the service goes only to its owners), so notificationService was 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):

  • history — one JSON file per moved notification under ~/.local/state/omarchy/notifications/history; historyDir now falls back to that path when the service object is unavailable, so the existing bash/awk history reader and its 500 ms poll work unchanged
  • DND — the service persists {dnd} to ~/.local/state/omarchy/notifications.json on every change; a watched FileView on that file now feeds dndOn (live, no polling), and toggleDnd falls back to the host's own notifications IPC target (omarchy-shell -q notifications toggleDnd) which is not capability-gated

clearAll no 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:

  • the live popup model cannot be reached without the service object, so the merged list shows on-disk history entries; live toasts keep arriving through the shell's own daemon and land in history when dismissed
  • dismissPopup/removeHistoryEntry remain 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

  • Reinstall/re-enable on Omarchy 4.0.3-1, omarchy restart shell
  • Open the popup: history entries list and refresh while open
  • Trigger a notification (dismiss it) → it appears in the list via history
  • Right-click toggles DND: the icon flips, and cat ~/.local/state/omarchy/notifications.json shows "dnd": true; toggling from Omarchy's own indicators updates the icon live through the file watcher
  • Clear all empties the list and the on-disk history

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant