Files
RedBear-OS/local/recipes/system/redbear-notifications
vasilito 7b8a1b2838 release: open 0.3.2 and sync Cat 1/Cat 2 version labels
New release branch per the release-branch model (operator decision;
local/AGENTS.md reserves branch creation to the operator).

sync-versions.sh, driven by bump-release.sh, rewrites:
  - Cat 1 in-house crates  -> version = 0.3.2
  - Cat 2 upstream forks   -> <upstream-tag>+rb0.3.2

Labels only; no fork source was rebased in this commit. bump-release.sh
reports these forks as having newer upstream tags, to be taken next:
  relibc   0.2.5  -> 0.6.0
  syscall  0.9.0  -> 0.9.1
  libredox 0.1.18 -> 0.1.19
redoxfs and redox-scheme are already current. kernel, bootloader and
installer are 'diverged' in the fork map and stay report-only (manual
rebase); bootloader additionally has no merge-base with upstream.
2026-08-03 11:04:40 +03:00
..

redbear-notifications

Notification daemon — freedesktop.org notification spec implementation

Status: FEATURE-INCOMPLETE Category: system Build: cargo build --release --manifest-path source/Cargo.toml

Purpose

redbear-notifications implements the org.freedesktop.Notifications D-Bus interface on the session bus. It provides a notification server compatible with the freedesktop.org Desktop Notifications Specification, enabling KDE applications (plasma-workspace, kf6-knotifications, application notification bubbles) to post and manage desktop notifications. Notifications are logged to stderr with ActionInvoked signal plumbing for client callback support.

D-Bus Interface

  • Bus: session
  • Well-known name: org.freedesktop.Notifications
  • Object path: /org/freedesktop/Notifications

Notifications Interface (org.freedesktop.Notifications)

Method Description
Notify(app_name, replaces_id, app_icon, summary, body, actions, hints, expire_timeout) Posts a new notification. Returns the notification ID. Handles replaces_id for updating existing notifications.
CloseNotification(id) Closes a notification by ID. Emits NotificationClosed signal with reason=3 (dismissed by user).
GetCapabilities() Returns ["body", "actions", "persistence", "action-icons"].
GetServerInformation() Returns ("redbear-notifications", "Red Bear OS", "0.3.1", "1.2").

Signals: NotificationClosed(id, reason), ActionInvoked(id, action_key)

Architecture

Single-file Rust binary (src/main.rs, ~858 lines). Uses zbus v5 + tokio.

Key types:

  • NotificationRecord — per-notification metadata: owner bus name, action keys, expire timeout, issuance timestamp
  • NotificationStateHashMap<u32, NotificationRecord> with insertion-order VecDeque and freed-ID pool
  • Notifications — thread-safe wrapper with Arc<AtomicU32> next-ID counter and Arc<Mutex<NotificationState>>

Lifecycle management:

  • Expiry sweeper: Background task runs every 500ms, closes notifications whose timeout has elapsed. Emits NotificationClosed with reason=1 (expired).
  • Sender reaper: Background task polls NameHasOwner every 2s for all tracked notification senders. Vanished bus names trigger automatic cleanup of all their notifications.
  • Freed-ID pool: Closed notification IDs are recycled — next_id only increments when the pool is empty.
  • Max capacity: 1024 active notifications; oldest-first eviction when the bound is reached.

Status Notes

  • Core spec compliance: Notify, CloseNotification, GetCapabilities, GetServerInformation all work.
  • Action support: ActionInvoked signal plumbing is in place. Action key storage in NotificationRecord allows clients to inspect which actions were registered.
  • Output: Notifications are logged to stderr. No GUI rendering daemon is integrated — the notification server handles the D-Bus protocol side; rendering is the responsibility of a notification display daemon (e.g., KDE plasma-workspace notification applet).
  • Expiry and cleanup: Fully implemented with automatic expiry, sender reaper, and ID recycling.
  • Input validation: Capped at 1024 entries. Expired notifications are drained before insertion to prevent resource exhaustion.

Cross-reference: local/docs/DBUS-INTEGRATION-PLAN.md