caelestia-niri/docs/HANDOFF.md

8.8 KiB

Handoff: start here

Rust/niri port of ladybug-me/caelestia-kde (a0bc311). Read this, then docs/AUDIT.md. Older notes: docs/NEXT-SESSION.md.

The rule

Port the original files 1:1. Do not invent designs, sizes, colours, spacing, animations or behaviour: read the QML/C++ and translate it. If something is KDE-only, replace only that part with the niri equivalent and say so.

Do not touch or "fix" toward the original

Nexus Shortcuts tab (caelestia-binds.kdl), Window Rules page (caelestia-windowrules.kdl), crates/core/src/niri.rs, scripts/03-niri.sh, assets/niri/*, bar defaults (dock, showDesktop, screencapture, keepawake off; bar.dodgeWindows rows gone; white distro logo; audioIncrement 0.05), removed KDE stuff (updates, plugins, KDE/KWin rows), scripts/ structure, crates/shell/src/fuzz.rs.

Setup

  • Original: clone https://github.com/ladybug-me/caelestia-kde read-only into the scratchpad and check out a0bc311 (the old clone was in a session scratchpad and may be gone). Never use gh; GitHub account is suspended.
  • Remote origin = forgejo:astar76/caelestia-niri.git. Commit each area and push to main.
  • Build: cargo build --release, about 2 minutes. Run it in the background.
  • After touching config or Nexus: cargo test --release, then cargo test --release -p caelestia-shell every_setting -- --ignored --nocapture (about 8 minutes, wants 0 crashed, 0 rejected).
  • Restart the live shell, telling the user first, every time: pkill -x caelestia-shell; sleep 0.5; setsid nohup ./target/release/caelestia-shell >/tmp/shell.log 2>&1 < /dev/null & disown
  • The user runs this shell live on niri with DMS stopped; keep DMS closed. Two 1600x900 monitors, DP-1 and HDMI-A-1.
  • Snapshot: ./target/release/caelestia-shell --snapshot out.png --size 1600x900 [--dashboard --tab N] [--nexus PAGE --sub SUB] [--launcher] [--background]. Test config: XDG_CONFIG_HOME=<dir> with its own caelestia/shell.json.
  • Nested niri needs a short runtime dir (/run/user/1000/cn), plus PIPEWIRE_RUNTIME_DIR=/run/user/1000 and PULSE_RUNTIME_PATH=/run/user/1000/pulse for audio. CAELESTIA_PROF=1 prints timings.
  • caelestia shell drawers toggle dashboard and caelestia shell dashboard tab N drive panels (binary in target/release).

Traps

  • Never pkill -f a pattern: it matches your own shell and kills the command (exit 144). Use pkill -x or a PID.
  • A while pgrep -f ... waiter matches itself and never ends.
  • grep caelestia-shell on plain top misses it: the name is truncated. Use top -c -w 200.
  • Do not script edits to ~/.config/caelestia/shell.json. It was refused. It holds general.apps.audio: true, which logs "ignoring" harmlessly; the user can delete that line. merge_typed drops only the bad key.
  • ~/.config/niri/gamemode.kdl is written by the user's dms-gamemode, not only by us.
  • Settings rows come from assets/nexus/pages.json; change them in add_niri_pages in nexus/mod.rs.
  • Unknown bar ids size to 0 in item_size.
  • Qt line height is ceil(ascent)+ceil(descent) (Painter::line_height); measure is a 1.25em box.
  • Report honestly: say what was only snapshot-tested and what was tested live.

State at the end of this session

Done and pushed: settings fuzz clean (876 tried, 0 crashed), CPU work, game mode cuts, bar popouts (Weather, Media, Performance, Shortcuts, Notes, Clock calendar) and right-click menus (bar items, dock). Dead keys wired. Live Network, Connected devices, Audio and App volumes rows in Nexus. Numbers are in docs/AUDIT.md.

Testing tools:

  • CAELESTIA_PROF=1 prints totals every 5 s: time per stage, and dirty wl.rs:LINE for what asked for a repaint.
  • caelestia shell popout weather|media|performance|shortcuts|notes|menu|close opens a popout on every monitor without a pointer.
  • caelestia shell gameMode toggle|enable|disable.
  • Real pointer: no tool is installed, and wtype only does keys. A small zwlr_virtual_pointer_v1 client built against the wayland-protocols-wlr crate in the cargo cache works. It was in the session scratchpad, not the repo, so rebuild it if needed.
  • Use XDG_STATE_HOME=<copy> too when a test creates notes, or they land in the user's real notes.
  • Never click Clear in the launcher's clipboard dialog against the real cliphist: PATH=<dir with a fake cliphist> first. Nexus's live switches and sliders drive real Wi-Fi, Bluetooth and volume.
  • Badges vanish when the sender leaves the bus, so gdbus emit is too short-lived to test them: keep a connection open (Python gi works).

Not confirmed or known wrong:

  • Game mode with music playing: the user paused the music before that run. The tap was confirmed stopped, but the "before" number was taken with nothing playing. Re-measure with music.
  • Mod+G still runs dms-gamemode toggle, not this shell's game mode. Bind it to caelestia shell gameMode toggle if wanted: that is the user's niri config, so ask.
  • dms-gamemode stays running with DMS stopped. It rewrites ~/.config/niri/gamemode.kdl whenever a window goes fullscreen or back, and at its own start, which undoes the niri half of our game mode. The shell half is safe (it uses ~/.local/state/caelestia/gamemode).
  • assets/images/wallpaper.webp was found deleted from the working tree during the session and restored from git. The fuzz does not do it (two more runs left it alone) and nothing in the code deletes it. Cause unknown; check git status before committing.
  • Two tray states were seen in screenshots after quick restarts: the > chevron missing once. Probably items re-registering. Not chased.
  • Stat pills on: 34% of a core with music, because the fill animation repaints the drawers about 27 times a second (3.3 ms each). Frames are within target, the rate is not.
  • Keybinds: assets/niri/caelestia.kdl holds the stock defaults, chosen for a fresh install; the user asked for this, so that file is no longer off limits for binds. It validates against a copy of the user's config, but caelestia niri install has not been run here, so their live keys still go to DMS until they switch. stock-binds.kdl is only the reference list the Shortcuts tab shows, and it does not yet show the shell's new defaults.
  • Blur needs xray false on caelestia-drawers, which is in caelestia.kdl. Until caelestia niri install runs, the live session blurs niri's empty backdrop, so the bar and panels look nearly flat. Measured in a nested niri: bar pixel (3, 4, 4) with xray, (30, 47, 70) without. The GPU cost of non-xray blur on the live session is not measured yet.

Next, in order

  1. Panels leftovers. Popouts not ported: Greeter (slideshow media, bar.popouts.greeter off by default), keyboard layouts, Night Light (built on Hyprsunset; no sunset tool here), Privacy (needs PipeWire stream tracking), DockHover (niri has no window capture), Updates and Github (removed or left out on purpose). In Notes: audio recording and playback, file pickers. Dead keys left, with nothing to attach to: sidebar.defaultTab and ai.showNews wait for the AI and News tabs. ai.showCaelestiaMode and BarScreenCapture show* are read nowhere in the original outside Nexus, so they stay dead there too.
  2. Desktop icons: the user has noticed they do not work (DesktopIcons.qml, desktopicons/*; the two Desktop rows do nothing). Then per-monitor bar position on Taskbar. Settings pages, what is left: Network's Add network, Hotspot, Add VPN and provider rows, IPv4 editing; Bluetooth pairing and device info; audio Device Profiles; Quick Share; Apps' default apps and All apps; Language & region's two widgets; Calendar sources (the clock popout's agenda needs scripts/calendar_events.py ported); Export configuration. Notifications, Utilities, Session and most of Services and AI are keyed rows that already work.
  3. Brief leftovers: quick toggles 1:1, clickable list editors (BarStatusIcons, QuickTogglesPage, pinned, favourites, hidden, target windows), rest of the audit, config paths into the niri folder with migration, media key rebinding, installer tests.

The user plans to switch to this shell as their daily setup once it is complete: prefer finishing and hardening over new features. Lock and idle use swaylock and swayidle, the user's choice: lock_screen and sync_idle in wl.rs, times in lock.idle*, and services::polkit_agent starts an agent. Before the switch: install swaylock swayidle polkit-gnome (none are installed yet, so a real lock has not been run) and run caelestia niri install. Test the real lock in a nested niri first: a stuck locker on the live session needs the user's password. swaylock has no blur, so lock.blurWallpaper and the original's lock screen rows are gone from that page.

Skipped by the user for now: desktop icons. Known missing: Choose system font, Terminal tab, video wallpapers, widget copy and paste, Escape leaving widget edit mode, Weather and Notes tab audits.