22 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, 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), Quick Share, Caelestia mode, crates/shell/src/fuzz.rs (only its sample data may follow a struct change). The user has opened up assets/niri/* for default binds and scripts/ for the installer.
Niri additions are fine when the user asks or KDE did the job; label them in docs/AUDIT.md.
Setup
- Original: clone https://github.com/ladybug-me/caelestia-kde read-only into the scratchpad and check out a0bc311. The clone takes
several minutes and goes in a session scratchpad, so make a new one, in the background. 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, thencargo test --release -p caelestia-shell every_setting -- --ignored --nocapture(about 6 minutes, wants 0 crashed). Run the fuzz and tests with a stand-insecret-toolon PATH: Nexus reads the keyring. - 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 owncaelestia/shell.json. - Nested niri needs a short runtime dir (
/run/user/1000/cn), plusPIPEWIRE_RUNTIME_DIR=/run/user/1000andPULSE_RUNTIME_PATH=/run/user/1000/pulsefor audio.CAELESTIA_PROF=1prints timings. caelestia shell toaster info|success|warn|error <title> <message> <icon>,notifs clear|toggleDnd|enableDnd|disableDnd|mute <app>|unmute <app>,lock preview.caelestia shell drawers toggle dashboardandcaelestia shell dashboard tab Ndrive panels (binary in target/release).
Traps
- Never
pkill -fa pattern: it matches your own shell and kills the command (exit 144). Usepkill -xor a PID. - A
while pgrep -f ...waiter matches itself and never ends. grep caelestia-shellon plaintopmisses it: the name is truncated. Usetop -c -w 200.- Do not script edits to
~/.config/caelestia/shell.json. It was refused. It holds ageneral.apps.audioboolean, which logs "ignoring" harmlessly; the user can delete that line.merge_typeddrops only the bad key. ~/.config/niri/gamemode.kdlis written by the user'sdms-gamemode, not only by us.- Settings rows come from
assets/nexus/pages.json; change them inadd_niri_pagesinnexus/mod.rs. - Unknown bar ids size to 0 in
item_size. - Qt line height is ceil(ascent)+ceil(descent) (
Painter::line_height);measureis a 1.25em box. - Report honestly: say what was only snapshot-tested and what was tested live.
- Size tokens are functions now (
PADDING_SMALL(),SPACING_MEDIUM(),ROUND_XL()), because they followappearance.*.scale. They cannot go in aconst. - The screen a thing is on matters: use
Shared::bar_position(output)orScreen::bar_edge, nevercfg.bar.position. - A background child that outlives the shell can break the machine: use
services::helper(it dies with the shell). Anexecrestart keeps the pid, so that alone is not enough. 64 orphanedpactl subscribeonce blocked every audio app. - The background layer reuses its last frame and restores only marked rects: anything painted there must go through
Bg::mark, or it leaves ghosts and its alpha stacks up. - A Nexus page built at runtime goes in
livepage::is_liveandexpand. If it reads none of the popout data, add it to the exclusions inwants_live, or it spawnspactl,nmcliandbluetoothctlon a timer. Changes tolive:keys arrive intake_live. - In the installer's bash,
((x))that evaluates to 0 tripsset -e: usex=$(( ))orif ((x)). - Snapshots do not wait for background reads (
syslook::look,rpc::shown_key, desktop icons), so check those on a running shell.
Where things stand
Everything is pushed to origin main and the shell runs live on the user's real config, by hand: see the state section below. Last checks: 69 tests passing, 3 known build warnings (layer, backend/candidate/offset, refresh), fuzz 871 tried, 0 crashed.
Done in the last session, each with a section in docs/AUDIT.md: the stuck volume OSD, Notifications (service, popups, sidebar, pages), the toaster, the Dino game (Caelestia mode removed), the lock screen, Displays, Timers, Session, Utilities, Apps, Services, Language, About, Startup, Storage, Accessibility.
The preview passed on 2026-11-05: the user's real password and keyboard unlocked it, lock-proved is written, and the shell's own lock is now their real one, idle lock included. The real session lock then ran on their two monitors the same day: locked at 03:49:09, unlocked with their password at 03:49:22, no crash. Recovery after a lost connection is tested in a nested niri only. History: the first version of the preview crashed the shell with the real session lock up, its 45 second unlock died with it, and the user had to restart niri. Their password was refused by our own bug: after pam_authenticate we called pam_acct_mgmt, and the swaylock service has no account section, so /etc/pam.d/other denied it (pam_warn(swaylock:account) in the journal). Fixed: only authenticate, as swaylock does. 8 s later niri dropped the shell (error in client communication, meaning the client fell behind). The lock repainted on every pointer event; that fits the logs, but a nested stall test did not reproduce the drop, so that cause is not proven. Since then the preview is an ordinary overlay with no session lock (Escape leaves, gone after 90 s), and lock_screen runs swaylock unless ~/.local/state/caelestia/lock-proved exists. Keep that gate: deleting the file goes back to swaylock. Never write a watchdog that lives inside the process it guards.
Before the switch, on 2026-11-05, these were not live: Print and every default bind (their Print runs DMS's command, ~/.config/niri/config.kdl line 277, and does nothing), Mod+G, xray false for blur (their config has a hand-added copy; remove it after, backup config.kdl.bak-blur-caelestia), caelestia-cursor.kdl, and caelestia-outputs.kdl, so Displays' kept settings do not survive a niri restart until then: their dms/outputs.kdl is what loads. They said to change Print in the installer's dotfiles, not in their own config. The include comes last and overrides their Print.
State at the end of 2026-11-05
- The user switched. DMS and
dms-gamemodeare stopped and out ofniri.service.wants, still installed.~/.local/bin/caelestia-shellruns live on the real config, andspawn-at-startupstarts it at login. A real login has not been tried. config.kdlno longer names DMS.caelestia-outputs.kdlandcaelestia-cursor.kdlcame from DMS's files, andcaelestia-recommended.kdlholds their layout, input and animations. Thedms/folder is still on disk, unused.- The way back:
caelestia-back-to-dmsfrom a text console, backup in~/.local/share/caelestia-dms-backup. It does not undo theme files written for other apps. - Packages still missing, needing sudo:
xdg-desktop-portal-gnome,gnome-keyring,qt6ct,udiskie. The PAM filecaelestia-lockis not installed either, so the lock uses theswaylockservice. - The new lock is proved and is their real lock:
~/.local/state/caelestia/lock-proved. swayidle locks at 10 minutes. - The
general.apps.audio: falsewarning at every start stays until they pick an Audio app on the Apps page. - Restart the live shell from niri, telling them first, so it does not inherit a tool's environment:
pkill -x caelestia-shell, thenniri msg action spawn-sh -- 'exec "$HOME/.local/bin/caelestia-shell" >"$HOME/.cache/caelestia-shell.log" 2>&1'. Install withinstall -m755 target/release/caelestia{,-shell} ~/.local/bin/.
0.1.0 and the clean install
v0.1.0 is on Astar Hub's Releases page. The user is wiping DMS, niri and Caelestia's configs with clean-wipe.sh, kept out of git, then running ./install.sh from a text console. That is the first real clean install: nothing has proved it end to end. After it: monitors have no saved arrangement until set in Displays, and the lock is swaylock until caelestia shell lock preview passes.
After the clean install (2026-11-05)
The first real clean install, from clean-wipe.sh, passed: no failed packages, login starts the shell, portals run. The login sync missed at install because no scheme existed yet: 05-extras.sh now sets the default wallpaper first. Still to do by hand: monitors in Displays, as niri's defaults swapped them and chose 60 Hz, and caelestia shell lock preview, because lock-proved went in the wipe.
Pick up here
docs/PLAN.md has the DMS audit: what a clean install now gets, what is left on the machine, and the binds to choose. The user means to wipe Arch of DMS, so the repo alone has to give a whole desktop. They will give their default binds and config changes before that.
Work this list top to bottom. Each item ends with tests, the fuzz if config or Nexus changed, a commit and a push.
- AI Assistant: removed at the user's request, 2026-11-05. Do not port it.
- Settings left to prove live. Clicking the new pages (Apps menus, App info, weather search, Startup, Storage, Accessibility, Focus, muted apps), the quick toggle wheel, Timers end to end, Displays' drag and Apply, sounds, inline reply, real notification images. The user said to test on their system: see "Testing settings for real" below. Anything needing the pointer needs them to agree first and the target checked in the same command.
- The installer and system setup: the list below. Then the user's switch from DMS, with them present, each step on their go-ahead:
./install.sh, disable DMS, stopdms-gamemode. - niri defaults:
docs/NIRI-DEFAULTS.mdhas what a bare niri lacks and proposed settings, none applied. The biggest gap is input: there is no way to set keyboard layout, repeat, mouse speed or touchpad without editing KDL. The user's decision: these go in the existing Connected devices tab (thebluetoothpage), not a new page. - Things only the real setup can prove, after the switch: System look on a real GTK and Qt app and niri's cursor; desktop icons on the real desktop, with Paste, Cut, the real clipboard and auto arrange; capture's satty save, clipboard, notification buttons and Pause; hover zones on a moved bar; Discord presence against real Vesktop, Discord or arRPC, and Steam detection; Wi-Fi, Bluetooth pairing and volume rows; game mode with music playing; idle lock firing by itself; lock recovery after a lost connection; the user's autostart on a real login.
- Notifications, what is left:
shouldPushunder a popout, popup removal slide,notifs.focusCalendar, Battery warnings (BatteryMonitorlevels), toasts' stack sliding when one closes, ExtraIndicator, bold and italics in bodies (the words and links are kept), the Notification sound picker on Sound effects, Volume tick on sliders. - Lock screen, what is left: password shapes do not morph or animate out; the error text has no flash; the keyboard layout button on the portrait layout; fingerprint and Howdy; the
lock.wallpaperPathrow; Switch User usesdm-tool, which SDDM does not have. (Done in S007, except fingerprint, Howdy and Switch User, left out by D-009.) - Ported nowhere yet, needs
caelestia-color: Smart color scheme and Color intensity, hidden until then. - Desktop icons, what is left: groups, large folders, arrow keys, Shift ranges, dragging to other apps and between monitors, the live drop preview, Pin to dock, the bundled monochrome icon set (a git submodule of the original).
- Panels leftovers. Popouts not ported: Greeter (slideshow media,
bar.popouts.greeteroff by default), keyboard layouts, Night Light (see NIRI-DEFAULTS), Privacy (needs PipeWire stream tracking), DockHover (niri has no window capture). Updates and Github are left out on purpose. In Notes: audio recording and playback, file pickers. Dead keys with nothing to attach to:sidebar.defaultTab,ai.showNews.ai.showCaelestiaModeand BarScreenCaptureshow*are read nowhere in the original outside Nexus. - Settings pages left: Network's Add VPN and provider rows, IPv4 editing; Calendar sources (the clock popout's agenda needs
scripts/calendar_events.pyported); the launcher's web search and its engine row; Shell language (translations); app icons in Apps' lists; File Types. Check pinned, favourites and hidden have clickable list editors.pages.jsonis older than a0bc311: comparePageDictionary.qmland each page before trusting it, as Displays, Startup, Storage, Accessibility and Calendar were missing. - Known missing: Terminal tab, video wallpapers (the Video Wallpapers rows have no reader), widget copy and paste, Escape leaving widget edit mode, Weather and Notes tab audits, News tab, config paths into the niri folder with migration, media key rebinding.
- A real clean install: a VM or throwaway user. Tested so far on a pty in a temporary HOME with stand-in
pacman,sudoandsystemctl, then booted in a nested niri. Fedora and Debian package names are unchecked. Non-xray blur's GPU cost is unmeasured.
The installer: what has to change
None of this is done. The installer has not been rerun since the notifications, lock and Displays work.
The user's decision (2026-11-05): what was found missing belongs in the installer, as options. Each is a tick on the installer's checklist, on by default where the shell needs it, so nothing is forced and nothing is left for the user to find out later. Each option should also show in Nexus, saying whether it is installed, where a page fits: devices and input in Connected devices. Details are in docs/NIRI-DEFAULTS.md. The options:
-
Screen sharing and file pickers:
xdg-desktop-portal-gnome,niri-portals.conf. -
Keyring:
gnome-keyring, unlocked at login through SDDM's PAM file, with sudo, asked first. -
Qt theming:
qt6ctandQT_QPA_PLATFORMTHEME. -
Automount:
udiskie, or the shell mounting on insert. -
Night light:
wlsunset(S012 picked it; the shell starts it itself, so no autostart entry). Add it to the package lists (Archextra; check the Fedora and Debian names). -
Video wallpapers:
mpvpaper(S014; AUR only on Arch, so it needs the AUR helper; check Fedora and Debian) andffmpegfor the frame that gives a video its colours. Optional: without mpvpaper the shell shows the frame and says so in a toast. -
X11 tray icons:
xembedsniproxy. -
Clipboard:
wl-clip-persistandcliphist store. -
Lock: the PAM file, then the preview.
-
Recommended niri settings:
caelestia-recommended.kdl. -
02-build-shell.shcopiesassets/, which now holds 17 MB ofsounds/andfonts/: check the data dir gets them and the shell finds them throughCAELESTIA_DATA_DIR. A missingsounds/orimages/dino*fails silently. -
PAM: building now links
libpam. Arch has it inpam; addlibpam0g-devto Debian's andpam-develto Fedora's build lists. Install/etc/pam.d/caelestia-lock(auth include login, no account lines: without an account section PAM falls toother, which is whypam_acct_mgmtmust stay out), with sudo, asking first.auth.rsalready prefers it. -
swaylock stays in the package lists until a preview has passed. A fresh install starts on swaylock and should tell the user to run
caelestia shell lock preview, or offer it at the end. -
03-niri.shmust carrycaelestia-outputs.kdl's include, whichassets/niri/caelestia.kdlhas. Theirdms/outputs.kdlalso defines both monitors: remove or order that include at the switch, or Displays' settings lose. -
Add to the package lists:
pipewireprovidespw-playandpw-dumpon Arch, check Fedora and Debian (pipewire-utils,pipewire-bin).util-linuxforlsblk. Optional:udiskie,wlsunset,qt6ct,xdg-desktop-portal-gnomeandgnome-keyringare listed but missing on this machine: find out why the old install skipped them. -
Portals: write
niri-portals.conf. Keyring: PAM line for SDDM, with sudo and asking first. See NIRI-DEFAULTS. -
Spawn
wl-clip-persist,cliphist storeandxembedsniproxyif the user wants them: check whatcaelestia.kdlalready does. -
The installer's README and summary still describe swaylock as the lock.
Not a bug to chase unless it comes back: capture Space closing the overlay was not reproduced in 114 tries (24 live, 90 nested) with every key and every close logged, and Capture::key has no path from Space to Close. wtype sends keycode 1, Escape on a normal keymap, so a race on its keymap is the likely cause, unproven. Seen on a real keyboard, log press_key and cap_close.
Other loose ends, not chased: assets/images/wallpaper.webp was once found deleted from the working tree, cause unknown, so check git status before committing. The tray's > chevron went missing once after quick restarts. Stat pills with music cost 34% of a core. Hardware encoding fails here even in plain ffmpeg with h264_vaapi, so recordings use the CPU. A DMS-era dms-gamemode still runs with DMS stopped.
Testing without touching the user's things
This session's rules, learned the hard way:
- Pointer:
tools/vptr(build it, usage at the top of its source).wtypefor keys. Never send a key or click unless the target is confirmed there, in the same command: a drawer seen a minute ago can be gone. A live try once put wheel events and two clicks in the user's terminal that way: a stray Escape hid Mulberry to its tray (its tray entry'sActivatebrought it back). - Never
pkill -xanything the user may have open, such as kitty: stop stand-ins by PID.pkill -x caelestia-shellis fine, told first. - Live test shell:
XDG_CONFIG_HOME=<copy>,XDG_STATE_HOME=<copy>, withpaths.screenshotsDirandpaths.recordingsDirin the scratchpad, andcapture.jsonwithcopyandnotifyoff. AddHOME=<dir>andXDG_DATA_HOME=<dir>when a test writes system look or desktop files. - Stand-ins on
PATH:secret-tool,gsettings(logset, passgetto the real one),gio,xdg-open,wl-copy,wl-paste,cliphist,arrpc(a Python socket doing Discord's handshake works). Nested niri for anything that hits the real clipboard, such as window capture, and for an empty desktop. - Nested niri:
XDG_RUNTIME_DIR=/run/user/1000/<short>,WAYLAND_DISPLAY=/run/user/1000/wayland-1to start it, thenWAYLAND_DISPLAY=wayland-1andNIRI_SOCKET=<its socket>for clients. Its window size changes after it opens: read it from agrimshot, and pass it asVPW,VPH. Find its shell byXDG_RUNTIME_DIRin/proc/<pid>/environ. A test shell there reaches PipeWire and pipewire-pulse only withPIPEWIRE_RUNTIME_DIR=/run/user/1000 PULSE_RUNTIME_PATH=/run/user/1000/pulse(else the visualiser, volume and privacy indicator see nothing). A popout opened by IPC closes as soon as the host pointer moves over the nested window: hover its item withvptrinstead. - Prove a setting by rendering it:
--snapshotwith it changed against a baseline, measured against the clock and visualiser's noise. A name match in the code passed rows that did nothing. - Nested niri stops taking input and frames while its window is hidden:
wtypehangs and--snapshotis the better check. A nested shell's swayidle runs real swaylock after 10 idle minutes, andwtypethen types into PAM as the user: setlock.idleLock,idleScreenOffandidleSuspendto 0 in the test config.grimcannot capture a locked session. - The lock's logic (
locktest <text>,locktest cut, test build only; there is nolocktest stall: stop the shell withkill -STOPfor a stall; a test state folder needs alock-provedfile): build withCAELESTIA_LOCK_TEST_PASSWORD=x cargo build --release -p caelestia-shell, copy the binary out, then rebuild without it (touch crates/shell/src/auth.rs). Only that build hascaelestia shell locktest <text>.--snapshot out.png --lock [--typed] [--wrong] [--frames N]draws it. Notifications need the nameorg.freedesktop.Notifications: a nested test shell gets it on a private bus,dbus-daemon --session --print-address --fork.--popups [--expand]draws popups and toasts. - Testing settings for real without the pointer: stop the live shell, run the build on the real session with
XDG_CONFIG_HOMEandXDG_STATE_HOMEon copies andlock.idle*at 0, change the copy,caelestia shell reload, send realnotify-sendortoaster, and comparegrim -o HDMI-A-1in zones. Size the zones for 900 tall, not a nested window. Restart the live shell in afinally. - Dead settings: for each
shell:key inpages.json, grep the snake-case leaf after a dot incrates/. A row that is visible with no reader does nothing. - Also:
CAELESTIA_PROF=1prints timings anddirty wl.rs:LINE.caelestia shell popout weather|media|performance|shortcuts|notes|clock|kblayout|nightlight|privacy|greeter|menu|close.caelestia shell capture [region|window|screen|scroll|text|record|gif|stop],capture now screen|window.caelestia shell nexus sub <Page>, twice if the window was closed.caelestia shell gameMode toggle|enable|disable. Badges need a live D-Bus sender (Pythongi).
The user plans to make this their daily setup: prefer finishing and hardening over new features. The lock is the shell's own, on ext-session-lock (lockscreen.rs, auth.rs, lock_screen in wl.rs), behind swaylock until proved. Idle uses swayidle: sync_idle, times in lock.idle*. services::polkit_agent starts an agent.