caelestia-niri/docs/HANDOFF.md

10 KiB

Handoff: where the port stands (2026-10-30)

Rust port of caelestia-kde for niri: 1:1 with the original minus the KDE-only features. Original source for reference: clone it and read shell/ (QML modules, C++ plugin under shell/plugin/src/Caelestia).

Done

  • crates/core: shell.json config (original key names, unknown keys kept on save), scheme (~/.local/state/caelestia/scheme.json), niri IPC (loose JSON, event stream), per-app theme switches (cli.json theme.enable*; unset = on only if the app's program is installed).
  • crates/shell (caelestia-shell): SCTK layer surfaces, tiny-skia + cosmic-text renderer. Screen border with rounded inner corners and inner shadow, exclusive-zone strips, bar on any edge (logo, niri workspaces with sliding active indicator, clock, status icons from sysfs + pactl subscribe, power), session drawer growing out of the border, keyboard nav, IPC socket $XDG_RUNTIME_DIR/caelestia-niri.sock, live reload of shell.json/scheme.json. caelestia-shell --snapshot out.png [--session] renders without a compositor.
  • crates/cli (caelestia): scheme set/list/reapply, wallpaper -f, themes list/enable/disable/clean, niri install (writes ~/.config/niri/caelestia.kdl, backs up and includes it), shell <cmd>. Only ticked apps get files; themes clean removes empty leftover folders (never files).
  • tools/extract-nexus.py → assets/nexus/pages.json: every Nexus page (17), sub-page (77) and row (709) from the original QML, with config keys and the C++ defaults (defaults.shell = shell.json, defaults.tokens = shell-tokens.json).

Tested: unit tests; nested niri (windows sit inside the frame, session drawer via IPC); CLI theming in a sandboxed HOME.

Nexus (the settings window)

crates/shell/src/nexus/: the original's Nexus, drawn by the shell as an xdg toplevel (app_id caelestia-nexus, floating via the window rule in assets/niri/caelestia.kdl). Opened with caelestia settings [page] / IPC nexus open|toggle|close [page], Mod+Comma. All 17 pages and 77 sub-pages from assets/nexus/pages.json; switch, stepper, dropdown, slider, text-field rows edit shell.json / shell-tokens.json (original keys and defaults, this port's defaults on top). Search uses the original's index. Info rows on About read the system. Added: Appearance → App themes (the per-app checkboxes, Apply, Clean up). caelestia-shell --snapshot out.png --nexus <page> [--sub Name] [--search text] renders it.

Not yet: rows the original fills at runtime (Repeaters: monitors, devices, networks, plugins) are hidden; rows that are custom code (device lists, shortcut editors, wallpaper grid, colour picker, ...) show as cards that do nothing; page-change animations. Regenerate the data with tools/extract-nexus.py <caelestia-kde checkout>.

Launcher

crates/shell/src/launcher/: the original's launcher drawer on the bottom edge (search pill, power buttons, results; 600 px wide, 57 px rows, launcher.maxShown rows). Apps from .desktop files (XDG dirs + Flatpak exports), icons from the GTK icon theme and what it inherits (PNG/SVG via resvg, loaded in the background at startup), ranked by match and launch count (~/.local/state/caelestia/launcher-usage.json), favourites first when empty. > lists the original's 19 actions (launcher.actions overrides); modes: >calc (qalc, Enter copies), >scheme, >variant, >wallpaper, >clipboard (cliphist), >windows (niri). >emoji, >keybinds, >animations say "not available yet". Open with Mod+Space, the bar logo, or caelestia shell drawers toggle launcher. caelestia-shell --snapshot out.png --launcher [search] renders it.

Not yet: the empty-search app browser (grid/categories), wallpaper thumbnails, app context menu (pin/hide), emoji/keybinds/animations modes, Windows hover previews.

OSD and solid drawers

osd.rs: modules/osd. A column of FilledSlider-style vertical sliders (30x150, filled in secondary, round inverse-surface handle with the icon, the percentage while dragging) on the right border (left when the bar is on the right), vertically centred, shown for osd.hideDelay (2 s) when the default sink's volume or mute changes (pactl subscribe via Status) or the backlight changes (sysfs polled every 250 ms; the slider is hidden on machines without one). Drag or wheel a slider to set volume (wpctl) or brightness (brightnessctl); hovering or dragging keeps it open; it sits beside the sidebar when that is open. osd.* keys come from shell.json (Config.osd; the microphone slider is off by default). caelestia shell drawers osd show; --snapshot ... --osd. Tested live on niri with DMS (shows, auto-hides, reacts to real volume changes). Not tested live: dragging and the brightness slider (no backlight here). Not ported: showing it when the utilities/overview are open.

appearance.transparency.solidDrawers (this port's addition, default on, Nexus → Appearance → Theme & Effects → Solid drawers): niri has no blur behind layer surfaces, so the sidebar, launcher, popouts, toasts, session menu and OSD are drawn opaque (Shared::drawing_drawer makes layer_of return alpha 1 while they paint). Off gives the original's translucency.

Code, not screenshots

The original's code is the reference (the user's rule): its README screenshot is older than the code. Defaults come from assets/defaults/shell.json, extracted from the C++ config nodes (tools/extract-nexus.py), and Config::load reads shell.json over them; never hand-copy a default. Font sizes are Qt points (1pt = 4/3 px, TextStyle takes points); empty font families mean the system font. Colours follow Colours.palette / tPalette / layer() as each QML component uses them (Shared::c/t/layer_of). Workspace shapes are a port of m3shapes (shapes.rs, Material shapes + morph).

Bar (default: bottom, from the code): logo (Caelestia logo, assets/logo.paths from Logo.qml), workspaces (shapes, window category icons, trailing indicator), greeter, dock (pinned + windows), update indicator, clock, status icons, show desktop (niri: jump to the empty workspace and back), power. Session menu per session/Content.qml with the kurukuru GIF.

Popouts (popouts.rs, data in popdata.rs): opened by hovering status icons and the update indicator (Bar.qml checkPopout), grown out of the bar's inner edge on any bar position, sized to content + 16px padding, size changes animated. Audio (outputs, volume, Input, Now playing per-app volumes; pactl/wpctl), Network (wireless list, rescan, VPN) and Ethernet (devices, connection details; nmcli), Bluetooth (enabled, discovering, devices with battery, connect; bluetoothctl), Battery (percentage, power profiles; powerprofilesctl), Notifications (DND), Keyboard Locks, Updates (Astar Hub latest release vs our version, every 6h). Settings buttons open the matching Nexus page (the original "detaches" there). --snapshot out.png --popout <name> [--expand] renders one with live data.

Tray (tray.rs, zbus): a StatusNotifier host, and the watcher too when no one owns org.kde.StatusNotifierWatcher (tested on a private bus; on the user's session DMS owns it today). Items' pixmaps/icon names/theme paths, change signals, Activate/SecondaryActivate, DBusMenu layouts and clicks. Bar: compact tray (expand arrow, expands on hover, click pins), 24px icons; hovering an icon opens its menu popout (TrayMenu.qml: separator-grouped cards, submenus with Back). caelestia-shell --tray-dump lists the bus's items and a menu; --snapshot ... --tray --popout traymenu renders it.

Notifications (notifs.rs, zbus): the org.freedesktop.Notifications daemon when the name is free (DMS holds it on the user's session today; tested on a private bus in nested niri). Toasts top-right hanging from the top border, newest first, 400px cards, app icon circle by urgency, actions as buttons, 5s default timeout (critical stays), DND hides toasts; the bell shows unread/DND; the popout's Clear all closes them. Sidebar (sidebar.rs): the notification history drawer on the right border (left when the bar is on the right), from NotifDock/NotifGroup/Notif: notifications stay in shared.notifs after their toast expires (max 50), grouped by app newest first; collapsed groups show groupPreviewNum (3) one-line rows, the count pill expands a group into full cards (wrapped body, action buttons); swipe a collapsed group or an expanded notification past 30% of its width to dismiss, click a notification with a default action to run it, Clear all, wheel scrolling, the Caelestia Mode card (toggles general.caelestiaMode, saved). Opening it hides the toasts. Open with Mod+N or caelestia shell drawers toggle sidebar; Escape or a click outside closes. --snapshot out.png --sidebar [--expand] renders it with sample notifications. Not yet for the sidebar: the AI Assistant and News tabs, the dino game (the empty state shows an icon instead), pin + drag-to-resize, hover-the-edge opening, notification images (only app icons), link activation, the expand-by-swipe gesture, remove animations.

Not yet: tray right-click context popout (traycontext), menu check/radio marks (the original does not draw them either), the wireless password popout, dock hover previews, the clock calendar and greeter popouts (off by default upstream), right-click context popouts, cava visualiser strip, night light, a notification daemon, the wallpaper-luminance term of layer().

Later

Dashboard, sidebar, notifications daemon, OSD, lock screen, overview, tray (SNI), popouts, wallpaper drawing, then packaging (releases folder, AppImage/tar.gz).

Dashboard (Mod+Alt+D, caelestia shell drawers toggle dashboard)

  • dashboard.rs: drawer hanging from the top, animated tab bar/size, Dashboard tab (user card, date/time, calendar, resource rings). dashdata.rs samples /proc every 1 s while open. dashperf.rs: Performance tab (CPU, storage, network sparkline, memory).
  • Not ported yet: weather (small widget + tab), media (small widget + tab, MPRIS), notes, terminal tab, GPU card, battery tank, storage disk picker, avatar face picker, hover-to-open, temperature on hardware without a hwmon match shows --.
  • Snapshots: caelestia-shell --snapshot out.png --dashboard --tab N. Not yet tested live on the user's niri.