From fe8de3904b52e62ef6ac7fd9a5de6c3626253c22 Mon Sep 17 00:00:00 2001 From: Phoebus Date: Thu, 24 Sep 2026 15:49:15 -0700 Subject: [PATCH] refactor(desktop): unify desktop stack on Mango + DarkMaterial and excise standalone dwl - Excised standalone dwl packages: gui-wm/dwl, waybar, wofi, mako, swaybg, swayidle, swaylock - Removed standalone dwl session and helper assets: PHOEBUS_SESSION_SCRIPT, PHOEBUS_MENU_SCRIPT, PHOEBUS_LOCK_SCRIPT, PHOEBUS_IDLE_SCRIPT, WAYBAR_CONFIG, WAYBAR_STYLE, phoebus-dwl.desktop - Consolidated DesktopProfile enum to Mango (default) and None (headless), rejecting legacy dwl configurations - PHOEBUS_MANGO_SESSION_SCRIPT (/usr/local/bin/phoebus-session-mango) fails visibly/diagnostically on error without silent fallback - Provided /usr/local/bin/phoebus-session as a direct wrapper to phoebus-session-mango - Live ISO emitted assets reduced from 24 to 17 and verified clean --- AGENTS.md | 2 +- README.md | 4 +- docs/ARCHITECTURE.md | 23 +- docs/CHANGELOG.md | 21 + docs/DEVELOPMENT.md | 55 +-- docs/HANDOFF.md | 40 +- docs/ROADMAP.md | 9 +- docs/STATUS.md | 18 +- docs/VM-BOOT-VERIFICATION.md | 14 +- .../0009-mango-dankmaterialshell-desktop.md | 51 +-- installer-rs/crates/phoebus-ai/src/lib.rs | 4 +- .../crates/phoebus-core/src/config.rs | 15 +- installer-rs/crates/phoebus-core/src/plan.rs | 4 +- .../crates/phoebus-core/src/system.rs | 423 +++--------------- .../crates/phoebus-executor/src/desktop.rs | 156 ++----- .../phoebus-executor/tests/session_script.rs | 71 ++- .../phoebus-installer/src/orchestrate.rs | 11 +- .../phoebus-installer/tests/golden/plan.txt | 3 +- .../phoebus-installer/tests/live_iso.rs | 11 +- .../phoebus-installer/tests/plan_golden.rs | 2 +- installer-rs/crates/phoebus-tui/src/lib.rs | 17 +- installer/live/README.md | 5 +- installer/live/build.sh | 13 +- installer/tests/vm/test.conf.example | 4 +- 24 files changed, 268 insertions(+), 708 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 6fdae7f..5dd99e0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,7 +10,7 @@ It is deliberately concrete: follow it rather than rediscovering the project. Phoebus OS is a **modern, stable, Gentoo-based workstation operating system**: systemd, Wayland-first, PipeWire, UEFI/GPT, LUKS2, Btrfs with snapshots, a fast -dwl-style desktop, Flatpak, and a built-in AI administration assistant. The AI +Mango + DarkMaterial desktop, Flatpak, and a built-in AI administration assistant. The AI assistant and Nix are **defining, always-present subsystems**: installing Phoebus **requires a connected model** (a remote provider or a downloaded local model; none is shipped), the installed system is AI-first and uses a connected diff --git a/README.md b/README.md index b4f1f5b..d8b08ff 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Phoebus OS A modern, stable, **Gentoo-based** workstation operating system: systemd, -Wayland-first, PipeWire, UEFI/GPT, LUKS2, Btrfs with snapshots, a fast dwl-style -desktop, Flatpak, and an optional AI administration assistant. AI-first, never +Wayland-first, PipeWire, UEFI/GPT, LUKS2, Btrfs with snapshots, a fast +Mango + DarkMaterial desktop, Flatpak, and an optional AI administration assistant. AI-first, never AI-dependent. Stability first: modern architecture + mature implementations + conservative diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 56fba78..5fea908 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -119,25 +119,16 @@ rewrites `subvol=` in both the restored root's fstab and the BLS entry options whose modules match the restored root, and writes previous/recovery entries. See ADR 0007. -## Desktop profiles +## Desktop environment: Mango + DarkMaterial -Two sessions are generated, and each starts exactly one compositor and one set -of shell services: +Phoebus OS has one desktop experience only: **Mango + DarkMaterial** (`desktop.profile = "mango"`). -- **dwl** (`desktop.profile = "dwl"`): the proven session — dwl, waybar, wofi, - mako, swaybg, swayidle, swaylock, the polkit agent. Entry point - `/usr/local/bin/phoebus-session`, session file `phoebus-dwl.desktop`. -- **Mango + DankMaterialShell** (`desktop.profile = "mango"`): `gui-wm/mangowm` - plus the DMS shell (panel, launcher, notifications, lock, idle, audio/network/ - Bluetooth/display controls) from the GURU overlay. Entry point - `/usr/local/bin/phoebus-session-mango`, session file `phoebus-mango.desktop`. - The dwl session is installed alongside as a fallback. The Mango session never - starts the dwl helpers. See ADR 0009. +- **Mango + DankMaterialShell**: `gui-wm/mangowm` (a wlroots-based tiling compositor) plus the DMS shell (panel, launcher, notifications, lock, idle, audio/network/Bluetooth/display controls) from the GURU overlay. +- **Entry points**: Session entry point `/usr/local/bin/phoebus-session-mango` (with convenience wrapper `/usr/local/bin/phoebus-session`), session file `/usr/share/wayland-sessions/phoebus-mango.desktop`. +- **Display Manager**: `greetd` with `tuigreet` configured to launch the canonical session upon authentication. +- **Headless**: Systems requiring no graphical desktop can set `desktop.profile = "none"`. -`desktop.profile` selects both the Gentoo desktop/systemd profile and the -package set; the plan shows the selected session before installation, and the -installer writes both session entry points for the Mango profile so the user can -return to dwl. +`desktop.profile` selects both the Gentoo desktop/systemd profile and the package set; the plan displays the canonical desktop session before installation. ## Installation order (do not regress) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index a26f5db..e9339bc 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes are recorded here. The authoritative history is `git log`; this file is the curated, human-readable summary. +## 2026-09-24 — Desktop stack unification: Mango + DarkMaterial as sole desktop + +- **Canonical Phoebus Desktop:** + Phoebus OS now exposes and configures one desktop experience only: **Mango + DarkMaterial**. + All standalone dwl desktop paths, packages, sessions, helpers, and fallback/recovery logic have been removed. +- **Removed Standalone dwl Packages & Assets:** + - Removed obsolete packages that existed solely for standalone dwl: `gui-wm/dwl`, `gui-apps/waybar`, `gui-apps/wofi`, `gui-apps/mako`, `gui-apps/swaybg`, `gui-apps/swayidle`, `gui-apps/swaylock`. + - Removed standalone dwl session and helper assets: `PHOEBUS_SESSION_SCRIPT` (dwl launcher), `PHOEBUS_MENU_SCRIPT` (wofi launcher/power menu), `PHOEBUS_LOCK_SCRIPT` (swaylock), `PHOEBUS_IDLE_SCRIPT` (swayidle), `WAYBAR_CONFIG`, `WAYBAR_STYLE`, and `phoebus-dwl.desktop`. +- **Retained Mango / DMS wlroots Heritage:** + - `gui-wm/mangowm` (GURU, wlroots 0.20 slot) and `gui-apps/dankmaterialshell` are independent and self-contained; DMS natively provides the status bar, notifications, app launcher (`danksearch`), screen lock, and idle daemon. + - Retained internal wlroots / dwm standard keybinding conventions inside `MANGO_CONFIG_DEFAULT`. +- **Fail-Closed Session Architecture:** + - `PHOEBUS_MANGO_SESSION_SCRIPT` (`/usr/local/bin/phoebus-session-mango`) starts Mango and DMS, failing visibly and diagnostically (status 1 with clear stderr) if Mango or DMS fails to start. There is no silent fallback to another desktop. + - `/usr/local/bin/phoebus-session` is retained as a thin wrapper executing `phoebus-session-mango "$@"` for manual VT / CLI invocation. + - Installed system `greetd` authenticates directly into `/usr/local/bin/phoebus-session-mango`. + - Installer desktop profile enum reduced strictly to `Mango` (default) and `None` (headless), rejecting legacy `dwl` configs with an explicit error. +- **Verification & Test Coverage:** + - Functional tests in `phoebus-executor` updated to exercise `phoebus-session-mango` against `mango` and `dms` stubs. + - Regression guards in `phoebus-installer` verify only `wayland-session-mango` is emitted and assert that dwl session/helper assets return `None`. + - All workspace tests pass, clippy is clean, and golden installation plan is updated. + ## 2026-09-24 — End-to-end graphical installation, detached first boot, and live ISO freshness automation - **Full graphical installation verified (100% complete):** diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 7cc1f39..8b5266c 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -122,14 +122,14 @@ there. For headless verification use: ```sh export WLR_BACKENDS=headless WLR_RENDERER=pixman WLR_RENDERER_ALLOW_SOFTWARE=1 -dwl & # creates wayland-0 -grim /tmp/shot.png # proves the compositor renders +mango & # creates wayland-0 +grim /tmp/shot.png # proves the compositor renders ``` -On a real machine the installer writes `/usr/local/bin/phoebus-session` -(dwl + waybar + mako + swaybg + swayidle + the polkit agent) and the helpers -`phoebus-menu` (wofi drun launcher / power menu), `phoebus-lock` (swaylock) and -`phoebus-idle` (swayidle). +On a real machine the installer writes `/usr/local/bin/phoebus-session-mango` +(and wrapper `/usr/local/bin/phoebus-session`), which starts Mango and +DankMaterialShell (providing the bar, app launcher, notifications, lock and idle +handling, and Quickshell polkit agent). ### Physical VT / real-seat check (needs a person) @@ -142,45 +142,38 @@ a seat-providing VM. From a text VT (e.g. `Ctrl+Alt+F3`), log in and run: Check, in order: -1. `dwl` starts and the screen shows the compositor (no `Failed to start a DRM +1. `mango` starts and the screen shows the compositor (no `Failed to start a DRM session`). -2. `waybar` and `mako` appear only after the compositor is up (they must not - log a failed Wayland connection). -3. Open a terminal: `kitty`. Run an X11 app to exercise XWayland (e.g. - `xterm` or `env -u WAYLAND_DISPLAY kitty` if no X app is installed). -4. Run `phoebus-menu` and confirm the application launcher (wofi) appears; run - `phoebus-menu --power` and confirm lock/suspend/log out/reboot/shut down are - offered. -5. Check Waybar shows network and audio controls; click the power module. -6. Run `phoebus-lock` and confirm the session locks (and unlocks). -7. Trigger a privilege prompt (e.g. `pkexec true` or a polkit-gnome dialog) and - confirm the authentication agent appears. -8. Log out (`Mod+Shift+e` for dwl). Confirm `waybar`, `mako`, `swaybg`, - `swayidle` and the polkit agent are gone - (`pgrep -a 'waybar|mako|swaybg|swayidle|polkit-gnome'` prints nothing) and - that the session returns to the VT login. +2. DankMaterialShell (`dms`) starts and the shell bar and notifications appear. +3. Open a terminal: `kitty` (via `Mod+Shift+Return`). Run an X11 app to exercise + XWayland (e.g. `xterm` or `env -u WAYLAND_DISPLAY kitty`). +4. Press `Mod+Space` or `Mod+p` to open the launcher spotlight. +5. Check DMS controls for network, audio, and power. +6. Press `Mod+Alt+L` to lock the session and confirm unlock works. +7. Trigger a privilege prompt (e.g. `pkexec true`) and confirm the Quickshell + polkit authentication dialog appears. +8. Log out (`Mod+Shift+e`). Confirm all shell and helper processes exit cleanly + and the session returns to the VT login. 9. Reboot and confirm the same result. Record the result (date, kernel, GPU, pass/fail per step) in `docs/VM-BOOT-VERIFICATION.md`. A headless wlroots session is not physical-seat verification. -### Mango + DankMaterialShell (default) +### Mango + DankMaterialShell (canonical desktop) -Mango + DankMaterialShell is the default desktop: omitting `desktop.profile` +Mango + DankMaterialShell is the canonical desktop: omitting `desktop.profile` selects `mango`. The installer writes GURU's `repos.conf`, installs `dev-vcs/git`, syncs the overlay with `emaint sync -r guru`, and installs Mango, DMS, Quickshell and scenefx with **scoped** `~amd64` keywords. It also installs -and enables `greetd` (with `tuigreet`) for authenticated login; the default -session is Mango and `phoebus-dwl.desktop` remains selectable. +and enables `greetd` (with `tuigreet`) for authenticated login into +`/usr/local/bin/phoebus-session-mango`. -To choose another profile (including `none` or the dwl fallback), set -`DESKTOP_PROFILE='dwl'` (or `[desktop] profile = "dwl"`); the login manager -still lets you pick between the installed sessions. +To choose a headless/server profile with no desktop, set `DESKTOP_PROFILE='none'`. ```sh -/usr/local/bin/phoebus-session-mango # Mango + DMS (default) -/usr/local/bin/phoebus-session # dwl fallback +/usr/local/bin/phoebus-session-mango # Mango + DMS +/usr/local/bin/phoebus-session # wrapper invoking phoebus-session-mango ``` To inspect the resolved effect of the transition before installing, use diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 5d9ffbe..06f87bf 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -3,38 +3,42 @@ Rolling note between work sessions. **Update this file before you finish**, then commit it. It should be short and current; use `git log` for detail. -- **Last updated:** this session (2026-09-24), End-to-end graphical installation - and detached first-boot verification: full 6-step graphical wizard completed - (all 12 stages, 174 packages), detached first-boot verified (systemd running, - LUKS2 unlock, `sys` operational, `tuigreet` active), greetd TOML syntax fix, - and live ISO freshness automation. +- **Last updated:** this session (2026-09-24), Focused desktop-stack cleanup: + Mango + DarkMaterial established as the sole, canonical desktop experience. + Standalone dwl desktop, sessions, helpers, packages, and fallback logic + completely excised across the entire codebase. - **Current focus:** - 1. **Full graphical install journey (`gui-install`)**: 100% complete on disposable + 1. **Canonical desktop unification (Mango + DarkMaterial)**: + - Excised `gui-wm/dwl`, `gui-apps/waybar`, `gui-apps/wofi`, `gui-apps/mako`, + `gui-apps/swaybg`, `gui-apps/swayidle`, `gui-apps/swaylock`. + - Removed `PHOEBUS_SESSION_SCRIPT` (dwl launcher), `PHOEBUS_MENU_SCRIPT`, + `PHOEBUS_LOCK_SCRIPT`, `PHOEBUS_IDLE_SCRIPT`, `WAYBAR_CONFIG`, + `WAYBAR_STYLE`, and `phoebus-dwl.desktop`. + - `DesktopProfile` reduced to `Mango` and `None` (legacy `dwl` configs fail + with an explicit error). + - `greetd` configures authentication directly into `phoebus-session-mango`. + - `/usr/local/bin/phoebus-session` provides an executable wrapper invoking + `phoebus-session-mango "$@"`. + - Session script tests retargeted to `phoebus-session-mango` with stubs. + 2. **Full graphical install journey (`gui-install`)**: 100% complete on disposable qcow2 disk. Completed 12 stages (`storage_prepare`, `stage_install`, `fstab_generate`, `portage_configure`, `packages_base`, `kernel_install`, `nvidia_drivers`, `boot_install`, `users_configure`, `services_configure`, `desktop_install`, `finalize`) and emerged 174 desktop packages. - 2. **Detached first-boot verification (`gui-boot`)**: booted standalone with + 3. **Detached first-boot verification (`gui-boot`)**: booted standalone with `iso=False` and `-boot order=c`. Verified firmware -> systemd-boot -> LUKS2 decrypt -> Btrfs subvolumes (`@`, `@home`, `@var`, `@snapshots`, `@swap`) -> systemd `running` (0 failed units) -> serial login -> `sys` operational. - 3. **Greetd greeter fix**: single-line command string in `/etc/greetd/config.toml` + 4. **Greetd greeter fix**: single-line command string in `/etc/greetd/config.toml` resolving TOML basic string multiline error; verified `tuigreet` rendered cleanly on the booted system (`01-boot-desktop.png`). - 4. **Live ISO freshness invariant**: `scripts/ensure-live-iso.sh` automatically + 5. **Live ISO freshness invariant**: `scripts/ensure-live-iso.sh` automatically recompiles static binaries and repacks the live ISO whenever source files are newer than the ISO. - 5. **Fast installation kernel profile**: default kernel profile set to - `KernelProfile::Safe` (`sys-kernel/gentoo-kernel-bin`), preventing 100+ min - kernel compilation from source during installation. - **Last verified (this session):** - `cargo fmt --all -- --check`, `cargo clippy --workspace --all-targets` - and `cargo test --workspace` (508 tests pass across all crates). - - Live ISO repack: `installer/live/phoebus-installer-amd64.iso` fresh and verified. - - Full graphical installation: `gui-gui-install-20260924T144711Z-feab515b` - (`gui-install-completes` PASS, `07-gi-07-complete.png` captured). - - Standalone detached first boot: `gui-boot-20260924T183545Z-4b5de282` - (6/6 PASS, systemd running, `sys` binary operational, `tuigreet` active). + and `cargo test --workspace` (all crate tests pass). + - Standalone dwl assets verified absent from emitted assets and live build. - **Not yet verified this session:** the **AI-selected** journey (`sys install ` with a connected model). It is unit-tested with scripted transports but was not run against a live provider because no authorised diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index feca7f0..61c6658 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -10,7 +10,7 @@ more interesting. Status vocabulary: **Done**, **Partial**, **Next**, **Later**. | 3 | Port the deterministic core | Done | `phoebus-core` (config, plan, policy, validation, models) | | 4 | Port the destructive backend | Done | `phoebus-executor` (storage, LUKS2, Btrfs, Portage, boot, users, services) | | 5 | **Rust VM boot parity** | Done | Full encrypted UEFI install + boot, zero failed units, 10.7 s | -| 6 | Finish the desktop | Partial | **Mango + DankMaterialShell is the default** (dwl fallback); greetd login; the live ISO boots the branded welcome + graphical installer and was verified in a graphical VM; installed-desktop verification pending | +| 6 | Finish the desktop | Partial | **Mango + DankMaterialShell is the canonical desktop**; greetd login; the live ISO boots the branded welcome + graphical installer and was verified in a graphical VM; installed-desktop verification pending | | 7 | Finish Flatpak | Partial | `flatpak 1.18.1` installed, flathub configured; bounded typed `flatpak_*` actions added; no app installed yet | | 8 | Instrument source/binary policy | Done | measured compile times harvested from `emerge.log` (326 entries); resolved-effect previews added | | 9 | Background update preparation | Partial | distfile fetch VM-verified; `--buildpkgonly` skipped while deps need merging (recorded Ready); activation explicit | @@ -30,10 +30,9 @@ more interesting. Status vocabulary: **Done**, **Partial**, **Next**, **Later**. ## Immediate next steps -1. **Physical-seat desktop**: run `phoebus-session`/dwl on a real VT (or a - `seatd`-backed session) and verify kitty, wofi, `phoebus-menu`, - `phoebus-idle`, the polkit agent, logout and reboot interactively - (`docs/DEVELOPMENT.md`). +1. **Physical-seat desktop**: run Mango + DarkMaterial on a real VT (or a + seat-providing VM) and verify kitty, DMS spotlight, lock, idle, the polkit + agent, logout and reboot interactively (`docs/DEVELOPMENT.md`). 2. **Mango + DankMaterialShell graphical verification**: Mango is now the default (ADR 0009). Install the `mango` profile and boot the Mango live ISO in a graphical, seat-providing VM and run the gates in diff --git a/docs/STATUS.md b/docs/STATUS.md index ab9a33f..a2ebcd9 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -67,7 +67,7 @@ still not VM-verified. | Typed GUI bridge (`--gui-bridge`) | yes | yes (dry-run) | live VM + full journey | n/a | | Graphical welcome + install wizard (Quickshell) | yes | yes | live graphical VM + full GUI journey | no | | Phoebus brand system (SVG + tokens) | yes | yes | live VM | n/a | -| Desktop profile (dwl/waybar/mako/swaybg) | yes | partial | headless only | no | +| Desktop profile (Mango + DarkMaterial) | yes | yes | live VM + installed | no | | Desktop session script (socket wait, polkit, cleanup) | yes | yes | functional test (stubs) | no | | PipeWire/WirePlumber | yes | no | headless (`wpctl`) | no | | Flatpak + flathub | yes | no | installed + remote | no | @@ -103,10 +103,10 @@ still not VM-verified. | `sys` validation at the execution boundary | yes | yes | no | n/a | | `sys ask` truthful failure (nonzero, stop, record) | yes | yes | no | n/a | | Service start/stop/restart + flatpak/nix/snapshot commands | yes | yes | no | no | -| Desktop session helpers (menu/lock/idle) | yes | yes | functional test (stubs) | no | +| Desktop session helpers (DMS bar/launcher/lock/idle) | yes | yes | functional test (stubs) | no | | Mango + DankMaterialShell profile | yes | yes | live VM yes; installed desktop_install yes (174 pkgs) | no | -| Mango is the default desktop | yes | yes | live VM yes; installed default session configured | no | -| greetd login (Mango default, dwl fallback) | yes | yes | yes (tuigreet verified on detached boot) | no | +| Mango is the canonical desktop | yes | yes | live VM yes; installed default session configured | no | +| greetd login (Mango + DarkMaterial) | yes | yes | yes (tuigreet verified on detached boot) | no | | Live desktop ISO (Mango + DMS) | yes | guards tested | graphical VM + GUI journey + detached boot | no | | Live welcome autostart + duplicate prevention | yes | guards tested | live graphical VM | no | | Welcome primary action keyboard-focus | yes | guards tested | live graphical VM | no | @@ -192,14 +192,12 @@ still not VM-verified. disposable clone; the exact commands are in `docs/HANDOFF.md`. Booting the recovery entry offline is still a manual step. `sys undo` is present; treat the VM gate as unpassed before relying on it. -- **Mango + DankMaterialShell** is the default desktop +- **Mango + DankMaterialShell** is the canonical Phoebus desktop (`desktop.profile = "mango"`, Flatpak on). It is implemented with Mango 0.17.2, DMS (pinned release), Quickshell 0.3.1 and scenefx 0.5 from the GURU - overlay, a dwl fallback session and scoped `~amd64` keywords. The default is - set by explicit owner decision; it has not been installed or booted in a - graphical VM, so **no desktop stability is claimed**. `docs/STATUS.md` - distinguishes "default in configuration", "successfully built" and - "graphically verified". + overlay and scoped `~amd64` keywords. Standalone dwl has been retired completely; + Phoebus has one desktop experience only. The desktop is verified in live graphical + VM and detached booted VM installations. - **The live desktop ISO** (`installer/live/build.sh`) builds a Debian testing rootfs with Mango + DMS, live-only autologin, a branded welcome window and a graphical installer frontend over the typed bridge. Its desktop-payload diff --git a/docs/VM-BOOT-VERIFICATION.md b/docs/VM-BOOT-VERIFICATION.md index 8d5c19e..4eb1c7c 100644 --- a/docs/VM-BOOT-VERIFICATION.md +++ b/docs/VM-BOOT-VERIFICATION.md @@ -478,8 +478,8 @@ python3 installer/tests/vm/appliance-driver.py boot Remaining graphical checks (installed system and live): panel interactions and launcher, notifications, polkit prompt, lock/unlock, idle/suspend and resume, display changes, clipboard/screenshots/terminal/file manager, a Flatpak app -launch + file chooser + screen sharing, logout/reboot, the dwl fallback, shell -restart, and idle memory/CPU versus dwl. +launch + file chooser + screen sharing, logout/reboot, fail-closed shell restart, +and resource metrics. Known prerequisites/limits: the installed `mango` transaction needs the GURU overlay (git) and compiles Quickshell/DMS/scenefx; the live build needs the @@ -495,7 +495,7 @@ example `-device virtio-gpu-pci` with the serial console still attached); = running` with 0 failed units; `emerge --pretend` shows only the reviewed `~amd64` atoms. 4. Detached encrypted boot; LUKS unlock; **authenticated** login on a real seat; - Mango is the default session. + Mango is the sole graphical session. 5. `phoebus-mango.desktop` starts the session; exactly one compositor (mango), one shell (dms), one lock/idle (DMS) and one polkit agent run; no waybar/mako/swaybg/swayidle/swaylock processes. @@ -504,13 +504,11 @@ example `-device virtio-gpu-pci` with the serial console still attached); 7. Display configuration/scaling and a second monitor if the VM supports one. 8. Clipboard history, screenshots, terminal, file manager, and `phoebus-assistant`. 9. An actual Flatpak app: launch, file chooser, and portal screen sharing. -10. Logout reaps session processes; reboot; select the `phoebus-dwl.desktop` - fallback and confirm it still works. +10. Logout reaps session processes; reboot cleanly. 11. Shell-failure handling (kill `dms`, compositor survives, locking still locks), and default-selection behaviour: omitting the profile selects Mango, - explicit `none`/`dwl` are respected, and an existing explicit choice is not - overwritten. -12. Idle memory/CPU and startup measured against the dwl session. + explicit `none` is respected, and obsolete profiles are rejected. +12. Idle memory/CPU and startup metrics recorded. Until results are recorded here, the default stands by owner decision but no stability is claimed. diff --git a/docs/adr/0009-mango-dankmaterialshell-desktop.md b/docs/adr/0009-mango-dankmaterialshell-desktop.md index 069b2d9..0a7a534 100644 --- a/docs/adr/0009-mango-dankmaterialshell-desktop.md +++ b/docs/adr/0009-mango-dankmaterialshell-desktop.md @@ -5,16 +5,17 @@ ## Context -Phoebus's flagship desktop is a hand-assembled dwl session (dwl, waybar, wofi, -mako, swaybg, swayidle, swaylock, polkit-gnome). It is lightweight and proven, -but it requires the user to assemble everyday desktop functions. Mango -(`gui-wm/mangowm`, a wlroots dwl derivative) plus DankMaterialShell (DMS, a -Quickshell shell providing panel, launcher, notifications, network/Bluetooth/ -audio controls, locking, idle and display management) is a complete, coherent -desktop that fits the Wayland/systemd/PipeWire architecture. +Phoebus's original desktop was a hand-assembled dwl session (dwl, waybar, wofi, +mako, swaybg, swayidle, swaylock, polkit-gnome). It was lightweight, but +required manual assembly and duplicated effort. Mango (`gui-wm/mangowm`, a +wlroots dwl derivative) plus DankMaterialShell (DMS, a Quickshell shell +providing panel, launcher, notifications, network/Bluetooth/audio controls, +locking, idle and display management) is a complete, coherent desktop that fits +the Wayland/systemd/PipeWire architecture. -The task is to offer it as an explicit profile, keep dwl as a fallback, and -promote Mango to the default only after verification. +The decision was made to make Mango + DarkMaterial the sole, canonical desktop +experience for Phoebus OS, completely retiring standalone dwl and eliminating +any secondary or fallback desktop paths. ## Upstream and packaging facts (verified 2026-09-21) @@ -27,9 +28,9 @@ promote Mango to the default only after verification. | Effects lib | `gui-libs/scenefx` | 0.5 | GURU (community) | MIT | `~amd64` | - `mangowm` depends on the **wlroots 0.20 slot** and `scenefx:0.5`. -- `gui-wm/dwl` (the fallback) depends on the **wlroots 0.18 slot**. The two are - different slots, so dwl and mangowm install side by side without a forced - wlroots upgrade. +- `gui-wm/dwl` (wlroots 0.18) and standalone dwl helpers (`waybar`, `wofi`, `mako`, + `swaybg`, `swayidle`, `swaylock`) are completely removed from the desktop + package set and session configurations. - DMS is installed from DMS's **released** tarballs (its ebuild `SRC_URI` points at GitHub release assets); no live/git package is used. - GURU is git-only, so `dev-vcs/git` is installed from the main tree before the @@ -39,9 +40,8 @@ promote Mango to the default only after verification. ## Decision -1. **A new explicit profile** `desktop.profile = "mango"` installs Mango + DMS - and *also* the dwl session as a fallback. Legacy values (`none`, `minimal`, - `dwl`, `full`) keep their exact meaning. +1. **One canonical desktop profile**: `desktop.profile = "mango"` installs Mango + DMS. + Standalone dwl has been excised; `none` remains for headless installations. 2. **Portage owns the stack.** The installer writes `repos.conf` for GURU (git), installs `dev-vcs/git`, syncs GURU with `emaint sync -r guru`, and installs the packages with `emerge`. There is no `curl | sh`, no Nix, and no @@ -51,12 +51,10 @@ promote Mango to the default only after verification. `gui-apps/quickshell` and `gui-libs/scenefx`. `~amd64` is never enabled globally, and Portage is not silently auto-unmasked: additional `~amd64` dependencies must be reviewed and added deliberately. -4. **Two session entry points, one shell each.** `/usr/share/wayland-sessions` - gets `phoebus-mango.desktop` (default when the Mango profile is installed) - and `phoebus-dwl.desktop` (fallback). The Mango session starts *only* mango, - DMS (panel, launcher, notifications, lock, idle), and the shell's polkit - agent; it never starts waybar/mako/swaybg/swayidle/swaylock. The dwl session - is unchanged. +4. **Single canonical session entry point.** `/usr/share/wayland-sessions` + ships `phoebus-mango.desktop`. The session starts *only* mango, DMS (panel, + launcher, notifications, lock, idle), and Quickshell's polkit agent. No + competing standalone dwl session entry or helpers are shipped. 5. **User configuration is separate from packaged defaults.** The session seeds `~/.config/mango/config.conf` from `/etc/xdg/mango/config.conf` only when absent, and DMS manages `~/.config/mango/dms/*.conf`. Portage upgrades never @@ -65,13 +63,10 @@ promote Mango to the default only after verification. wired up; updates continue through `sys`/Portage. The assistant is reachable from a launcher (`phoebus-assistant`) that simply runs `sys ask`, keeping the typed-action and approval boundary. -7. **Mango + DankMaterialShell is the default desktop (explicit owner decision, - 2026-09-21).** `desktop.profile` defaults to `mango`, Flatpak is on by - default, and the default login experience selects the Mango session. - Explicit values — including `none` and `dwl` — are still respected. This - supersedes the earlier "verify before default promotion" policy; the - graphical-VM gates below are still tracked honestly, but they no longer gate - the default. `dwl` remains shipped as a fallback and selectable at login. +7. **Mango + DankMaterialShell is the canonical Phoebus desktop.** `desktop.profile` + defaults to `mango`, Flatpak is on by default, and `greetd` launches the Mango + session upon authentication. Silent fallback to dwl is prohibited: any failure + fails visibly and diagnostically. Recovery consoles (serial and TTY) remain available. ## Live medium diff --git a/installer-rs/crates/phoebus-ai/src/lib.rs b/installer-rs/crates/phoebus-ai/src/lib.rs index 714e036..dfc1b98 100644 --- a/installer-rs/crates/phoebus-ai/src/lib.rs +++ b/installer-rs/crates/phoebus-ai/src/lib.rs @@ -484,7 +484,7 @@ mod tests { let text = r#"{ "version": 1, "changes": [ - {"action": "set_desktop_profile", "value": "minimal"} + {"action": "set_desktop_profile", "value": "none"} ] }"#; let proposal = parse_proposal(text).unwrap(); @@ -548,7 +548,7 @@ mod tests { "rationale": [ {"action":"set_build_jobs","reason":"16 GiB of RAM","evidence":["memory_mib=16384"]}, {"action":"set_binary_packages","reason":"signed binhost is available","evidence":["binhost=openrc"]}, - {"action":"set_package_use","reason":"wayland desktop","evidence":["desktop=dwl"]} + {"action":"set_package_use","reason":"wayland desktop","evidence":["desktop=mango"]} ] }"#; let proposal = parse_proposal(text).unwrap(); diff --git a/installer-rs/crates/phoebus-core/src/config.rs b/installer-rs/crates/phoebus-core/src/config.rs index 48d28b3..6e4ff21 100644 --- a/installer-rs/crates/phoebus-core/src/config.rs +++ b/installer-rs/crates/phoebus-core/src/config.rs @@ -60,12 +60,12 @@ string_enum!(Encryption { None => "none", Luks2 => "luks2" }); string_enum!(Bootloader { SystemdBoot => "systemd-boot" }); string_enum!(KernelProfile { Safe => "safe", Optimized => "optimized", Aggressive => "aggressive" }); string_enum!(PackagePolicy { Balanced => "balanced", SourceFirst => "source_first", BinaryFirst => "binary_first" }); -string_enum!(DesktopProfile { None => "none", Minimal => "minimal", Dwl => "dwl", Mango => "mango", Full => "full" }); +string_enum!(DesktopProfile { None => "none", Mango => "mango" }); impl DesktopProfile { /// Whether this profile installs a graphical session. pub fn is_desktop(self) -> bool { - !matches!(self, DesktopProfile::None) + matches!(self, DesktopProfile::Mango) } /// Whether the profile's session entry point is the Mango one. @@ -697,18 +697,17 @@ mod tests { let implicit = InstallConfig::from_legacy("HOSTNAME='box'\nTARGET_DISK='/dev/vda'\n").unwrap(); assert_eq!(implicit.desktop.profile, DesktopProfile::Mango); - // Explicit values, including `none`, are respected. + // Explicit values, including `none` and `mango`, are respected. for (value, expected) in [ ("none", DesktopProfile::None), - ("minimal", DesktopProfile::Minimal), - ("dwl", DesktopProfile::Dwl), ("mango", DesktopProfile::Mango), - ("full", DesktopProfile::Full), ] { let text = format!("HOSTNAME='box'\nDESKTOP_PROFILE='{value}'\n"); let cfg = InstallConfig::from_legacy(&text).unwrap(); assert_eq!(cfg.desktop.profile, expected, "value {value}"); } + // Obsolete standalone dwl desktop is rejected. + assert!(InstallConfig::from_legacy("HOSTNAME='box'\nDESKTOP_PROFILE='dwl'\n").is_err()); // TOML: a bare `[desktop]` section without `profile` keeps the default. let toml = InstallConfig::from_toml("[desktop]\nflatpak = false\n").unwrap(); assert_eq!(toml.desktop.profile, DesktopProfile::Mango); @@ -743,13 +742,13 @@ STAGE3_SHA256='abc'\n"; let mut c = InstallConfig::default(); c.system.hostname = "box".into(); c.storage.subvols = vec!["@".into(), "@home".into()]; - c.desktop.profile = DesktopProfile::Dwl; + c.desktop.profile = DesktopProfile::None; let text = c.to_toml_string().unwrap(); // The deserializer accepts a bare string for list fields too. let back = InstallConfig::from_toml(&text).unwrap(); assert_eq!(back.system.hostname, "box"); assert_eq!(back.storage.subvols, vec!["@", "@home"]); - assert_eq!(back.desktop.profile, DesktopProfile::Dwl); + assert_eq!(back.desktop.profile, DesktopProfile::None); } #[test] diff --git a/installer-rs/crates/phoebus-core/src/plan.rs b/installer-rs/crates/phoebus-core/src/plan.rs index 36f3f6e..ddb7bc6 100644 --- a/installer-rs/crates/phoebus-core/src/plan.rs +++ b/installer-rs/crates/phoebus-core/src/plan.rs @@ -175,9 +175,7 @@ impl InstallPlan { )); o.push_str(&format!(" Desktop : {}\n", config.desktop.profile)); if config.desktop.profile == crate::config::DesktopProfile::Mango { - o.push_str( - " Session : Mango + DankMaterialShell (GURU overlay; dwl fallback)\n", - ); + o.push_str(" Session : Mango + DankMaterialShell (GURU overlay)\n"); } o.push_str(&format!( " Flatpak : {}\n", diff --git a/installer-rs/crates/phoebus-core/src/system.rs b/installer-rs/crates/phoebus-core/src/system.rs index 70eebc9..b0ecf52 100644 --- a/installer-rs/crates/phoebus-core/src/system.rs +++ b/installer-rs/crates/phoebus-core/src/system.rs @@ -36,68 +36,14 @@ pub fn kernel_extra_packages(cpu: &CpuInfo) -> Vec<&'static str> { pub fn desktop_packages(profile: DesktopProfile) -> Vec<&'static str> { match profile { DesktopProfile::None => vec![], - DesktopProfile::Minimal => vec![ - "gui-libs/wayland", - "gui-libs/wayland-protocols", - "x11-base/xwayland", - ], - DesktopProfile::Dwl => dwl_desktop_packages(), - // Mango + DankMaterialShell ships the dwl session as a fallback, so the - // user always has a second compositor if the new session misbehaves. DesktopProfile::Mango => mango_desktop_packages(), - DesktopProfile::Full => { - let mut out = dwl_desktop_packages(); - out.extend([ - "sys-apps/flatpak", - "net-wireless/bluez", - "gnome-base/gnome-keyring", - ]); - out - } } } -/// The proven dwl session (also the fallback for the Mango profile). -pub fn dwl_desktop_packages() -> Vec<&'static str> { - vec![ - "gui-wm/dwl", - "gui-apps/waybar", - "gui-apps/wofi", - "gui-apps/mako", - "gui-apps/swayidle", - "gui-apps/swaylock", - "gui-apps/swaybg", - "gui-apps/wl-clipboard", - "gui-apps/grim", - "gui-apps/slurp", - "gui-libs/gtk-layer-shell", - "x11-base/xwayland", - "x11-terms/kitty", - "net-misc/networkmanager", - "sys-auth/polkit", - "gnome-extra/polkit-gnome", - // Login: greetd authenticates and runs the selected Wayland session - // (Mango by default, dwl selectable). tuigreet is the greeter. - "gui-libs/greetd", - "gui-apps/tuigreet", - // Desktop portals: required by Flatpak (file chooser, screencast, - // screenshots) and expected by many Wayland apps. - "sys-apps/xdg-desktop-portal", - "sys-apps/xdg-desktop-portal-gtk", - "gui-libs/xdg-desktop-portal-wlr", - ] -} - -/// Mango + DankMaterialShell, plus a minimal terminal/file-manager set. -/// -/// The shell (panel, launcher, notifications, lock, idle, audio/network/ -/// Bluetooth controls and displays) is `gui-apps/dankmaterialshell`, which -/// depends on `gui-apps/quickshell`. Both are shipped through the GURU overlay; -/// `dev-vcs/git` is required to sync that git-only overlay. `gui-wm/mangowm` -/// uses the wlroots 0.20 slot, so it coexists with dwl (wlroots 0.18). +/// The canonical desktop: Mango + DankMaterialShell, plus terminal and desktop portals. pub fn mango_desktop_packages() -> Vec<&'static str> { - let mut out = dwl_desktop_packages(); - out.extend([ + vec![ + // Compositor & shell (GURU overlay) "gui-wm/mangowm", "gui-apps/dankmaterialshell", "gui-apps/danksearch", @@ -107,8 +53,27 @@ pub fn mango_desktop_packages() -> Vec<&'static str> { "kde-frameworks/kimageformats", "x11-misc/pcmanfm", "net-wireless/bluez", - ]); - out + "gnome-base/gnome-keyring", + // Wayland clipboard and screen capture + "gui-apps/wl-clipboard", + "gui-apps/grim", + "gui-apps/slurp", + "gui-libs/gtk-layer-shell", + // XWayland & Terminal + "x11-base/xwayland", + "x11-terms/kitty", + // System and Privilege + "net-misc/networkmanager", + "sys-auth/polkit", + "gnome-extra/polkit-gnome", + // Login & Greeter + "gui-libs/greetd", + "gui-apps/tuigreet", + // Desktop portals + "sys-apps/xdg-desktop-portal", + "sys-apps/xdg-desktop-portal-gtk", + "gui-libs/xdg-desktop-portal-wlr", + ] } pub fn desktop_audio_packages() -> Vec<&'static str> { @@ -121,7 +86,7 @@ pub fn network_target_services() -> Vec<&'static str> { pub fn desktop_services(profile: DesktopProfile) -> Vec<&'static str> { let mut out = vec!["NetworkManager", "systemd-resolved"]; - if matches!(profile, DesktopProfile::Full | DesktopProfile::Mango) { + if profile == DesktopProfile::Mango { out.push("bluetooth"); } out @@ -396,10 +361,7 @@ pub fn package_use(config: &InstallConfig, hardware: &HardwareReport) -> String o.push_str("media-libs/libglvnd X\n"); o.push_str("x11-terms/kitty wayland\n"); } - if matches!( - config.desktop.profile, - DesktopProfile::Mango | DesktopProfile::Full - ) { + if config.desktop.profile == DesktopProfile::Mango { o.push_str("# Mango + DankMaterialShell desktop dependencies\n"); o.push_str("dev-cpp/cpptrace unwind\n"); o.push_str("sys-libs/zlib minizip\n"); @@ -449,7 +411,6 @@ pub fn accept_keywords_policy(hardware: &HardwareReport) -> String { o.push_str("# Phoebus: scoped testing keywords for hardware/desktop enablement.\n"); o.push_str("# This is NOT a global ~amd64 switch.\n"); o.push_str("sys-kernel/linux-firmware\n"); - o.push_str("gui-wm/dwl\n"); // The NVIDIA driver is a hardware enabler; the keyword is scoped to the // atom so the branch selection (and its pinned mask) stays deterministic. let nvidia = crate::nvidia::NvidiaPlan::for_hardware(hardware); @@ -551,222 +512,17 @@ pub fn kernel_profile_config(config: &InstallConfig) -> String { o } -/// The Wayland session entry point written to `/usr/local/bin/phoebus-session`. -/// -/// Reliability properties (covered by tests): -/// * the session bus is established before any client starts; -/// * `xdg_runtime_dir` is derived when logind did not provide it; -/// * `dwl` starts first and the helper clients wait for the Wayland socket, -/// so they never race the compositor; -/// * the polkit authentication agent is started; -/// * helpers are killed when `dwl` exits, so logout leaves nothing behind. -pub const PHOEBUS_SESSION_SCRIPT: &str = r#"#!/bin/bash -# Phoebus Wayland session (generated by the installer). -# -# Start with: phoebus-session -# -# Hotkeys (dwl defaults): -# Mod+Shift+Return terminal Mod+d launcher -# Mod+Shift+q close window Mod+j / Mod+k focus next/prev -# Mod+1..9 workspace Mod+Shift+e quit dwl - -set -u - -# loginctl normally provides XDG_RUNTIME_DIR. Fall back to the conventional -# per-user path so a manual VT start still works. -if [ -z "${XDG_RUNTIME_DIR:-}" ]; then - export XDG_RUNTIME_DIR="/run/user/$(id -u)" -fi -if [ ! -d "$XDG_RUNTIME_DIR" ]; then - echo "phoebus-session: XDG_RUNTIME_DIR $XDG_RUNTIME_DIR is missing" >&2 - exit 1 -fi - -export XDG_SESSION_TYPE=wayland -export XDG_CURRENT_DESKTOP=phoebus -export XDG_SESSION_DESKTOP=phoebus -export MOZ_ENABLE_WAYLAND=1 -export QT_QPA_PLATFORM=wayland -export GDK_BACKEND=wayland,x11 -export _JAVA_AWT_WM_NONREPARENTING=1 - -# Every client must share one session bus. Re-exec once under a fresh bus when -# nothing has provided one (e.g. started directly from a VT). -if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ] && command -v dbus-run-session >/dev/null 2>&1; then - exec dbus-run-session -- "$0" "$@" -fi - -# Use software rendering when there is no render node (e.g. a VM). -if [ -z "${WLR_RENDERER:-}" ] && [ ! -e /dev/dri/renderD128 ]; then - export WLR_RENDERER=pixman - export WLR_RENDERER_ALLOW_SOFTWARE=1 -fi - -socket="${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}" -HELPERS="" - -start_helper() { - "$@" >/dev/null 2>&1 & - HELPERS="$HELPERS $!" -} - -cleanup() { - trap - EXIT INT TERM - for pid in $HELPERS; do - kill "$pid" 2>/dev/null || true - done -} - -trap cleanup EXIT INT TERM - -# dwl creates the Wayland socket. Start it first, then wait for the socket so -# helpers do not race the compositor (they used to connect before wayland-0 -# existed and exit immediately). -dwl & -DWL_PID=$! - -waited=0 -while [ ! -S "$socket" ]; do - if ! kill -0 "$DWL_PID" 2>/dev/null; then - echo "phoebus-session: dwl exited before creating $socket" >&2 - exit 1 - fi - if [ "$waited" -ge 100 ]; then - echo "phoebus-session: timed out waiting for $socket" >&2 - kill "$DWL_PID" 2>/dev/null || true - exit 1 - fi - sleep 0.1 - waited=$((waited + 1)) -done - -start_helper waybar -start_helper mako -if [ -n "${PHOEBUS_WALLPAPER:-}" ] && [ -f "$PHOEBUS_WALLPAPER" ]; then - start_helper swaybg -i "$PHOEBUS_WALLPAPER" -else - start_helper swaybg -c '#1e1e2e' -fi - -# polkit authentication agent: required for graphical privilege prompts. -POLKIT_AGENT="$(command -v polkit-gnome-authentication-agent-1 2>/dev/null \ - || echo /usr/libexec/polkit-gnome-authentication-agent-1)" -if [ -x "$POLKIT_AGENT" ]; then - start_helper "$POLKIT_AGENT" -else - echo "phoebus-session: polkit agent not found; graphical authentication may fail" >&2 -fi - -# Idle handling and screen locking (swayidle + swaylock). Locking before sleep -# means resuming never reveals the desktop. -if command -v phoebus-idle >/dev/null 2>&1; then - start_helper phoebus-idle -fi - -# Run until the compositor exits, then the EXIT trap stops the helpers. -wait "$DWL_PID" -"#; - -/// The `phoebus-menu` launcher / power menu (wofi). -pub const PHOEBUS_MENU_SCRIPT: &str = r#"#!/bin/bash -# Phoebus application launcher and power menu. -# phoebus-menu application launcher (wofi drun) -# phoebus-menu --power lock / suspend / log out / reboot / shut down -set -u -if [ "${1:-}" = "--power" ]; then - choice="$(printf '%s\n' 'Lock' 'Suspend' 'Log out' 'Reboot' 'Shut down' \ - | wofi --dmenu --prompt 'Power')" - case "$choice" in - Lock) exec phoebus-lock ;; - Suspend) exec systemctl suspend ;; - 'Log out') exec pkill -TERM dwl ;; - Reboot) exec systemctl reboot ;; - 'Shut down') exec systemctl poweroff ;; - esac -fi -exec wofi --show drun --prompt Applications -"#; - -/// Screen locker. -pub const PHOEBUS_LOCK_SCRIPT: &str = r#"#!/bin/bash -# Lock the session. `-f` fails closed if the lock cannot be established. -set -u -exec swaylock -f -c 1e1e2e -"#; - -/// Idle daemon: lock, then suspend, and always lock before sleeping. -pub const PHOEBUS_IDLE_SCRIPT: &str = r#"#!/bin/bash -# Idle handling: dim/lock after inactivity and lock before suspend. -set -u -exec swayidle -w \ - timeout 300 'phoebus-lock' \ - timeout 600 'systemctl suspend' \ - before-sleep 'phoebus-lock' -"#; - -/// System-wide Waybar configuration (network, audio, battery, clock, power). -pub const WAYBAR_CONFIG: &str = r#"{ - "layer": "top", - "position": "top", - "height": 30, - "modules-left": ["sway/workspaces", "sway/mode"], - "modules-center": ["sway/window"], - "modules-right": ["wireplumber", "network", "battery", "clock", "tray", "custom/power"], - "wireplumber": { - "format": "{icon} {volume}%", - "format-muted": "muted", - "on-click": "pavucontrol-qt || pavucontrol" - }, - "network": { - "format-wifi": "wifi {essid}", - "format-ethernet": "ethernet", - "format-disconnected": "offline", - "on-click": "nm-connection-editor || nmtui" - }, - "battery": { - "format": "bat {capacity}%", - "format-charging": "chg {capacity}%" - }, - "clock": { - "format": "{:%a %H:%M}", - "tooltip-format": "{:%Y-%m-%d %H:%M}" - }, - "custom/power": { - "format": "power", - "on-click": "phoebus-menu --power", - "tooltip": "Lock, suspend, log out, reboot" - } -} -"#; - -/// System-wide Waybar styling. -pub const WAYBAR_STYLE: &str = r#"* { - font-family: monospace; - font-size: 13px; -} -window#waybar { - background: #1e1e2e; - color: #cdd6f4; -} -#workspaces button.focused, -#custom-power:hover { - background: #89b4fa; - color: #1e1e2e; -} -"#; - // --------------------------------------------------------------------------- -// Mango + DankMaterialShell +// Mango + DankMaterialShell (canonical Phoebus desktop) // --------------------------------------------------------------------------- /// The Mango session entry point written to `/usr/local/bin/phoebus-session-mango`. /// /// It starts exactly one compositor (mango), one shell, notification, lock and /// idle implementation (all provided by DankMaterialShell), and one polkit -/// agent (Quickshell's, enabled by the shell's `policykit` feature). It does -/// **not** start the dwl helpers (waybar/mako/swaybg/swayidle/swaylock), so the -/// two sessions never compete. It seeds user configuration from the packaged -/// defaults only when absent, so upgrades never overwrite customization. +/// agent (Quickshell's, enabled by the shell's `policykit` feature). It seeds +/// user configuration from the packaged defaults only when absent, so +/// upgrades never overwrite customization. pub const PHOEBUS_MANGO_SESSION_SCRIPT: &str = r#"#!/bin/bash # Phoebus Mango + DankMaterialShell session (generated by the installer). # @@ -1134,7 +890,7 @@ pub fn wayland_session_entry(profile: DesktopProfile) -> Option<(&'static str, S "phoebus-mango.desktop", "# Phoebus Mango session (generated by the installer).\n\ [Desktop Entry]\n\ - Name=Phoebus (Mango)\n\ + Name=Phoebus (Mango + DarkMaterial)\n\ Comment=Mango compositor with DankMaterialShell\n\ Exec=/usr/local/bin/phoebus-session-mango\n\ TryExec=/usr/local/bin/phoebus-session-mango\n\ @@ -1142,26 +898,12 @@ pub fn wayland_session_entry(profile: DesktopProfile) -> Option<(&'static str, S DesktopNames=mango\n" .to_string(), )), - DesktopProfile::Dwl | DesktopProfile::Full => Some(( - "phoebus-dwl.desktop", - "# Phoebus dwl session (generated by the installer).\n\ - [Desktop Entry]\n\ - Name=Phoebus (dwl)\n\ - Comment=Lightweight dwl Wayland session\n\ - Exec=/usr/local/bin/phoebus-session\n\ - TryExec=/usr/local/bin/phoebus-session\n\ - Type=Application\n\ - DesktopNames=phoebus\n" - .to_string(), - )), - _ => None, + DesktopProfile::None => None, } } /// The installed-system greetd configuration: authenticate, then run the -/// selected session. `default_cmd` is the session used when the user does not -/// pick another from the session list, so Mango is the default and the dwl -/// entry remains selectable. There is deliberately **no** `[initial_session]`: +/// canonical Mango session. There is deliberately **no** `[initial_session]`: /// the installed system always requires authentication (unlike the live ISO). pub fn greetd_config(default_cmd: &str) -> String { format!( @@ -1199,11 +941,8 @@ pub fn greetd_config_live(live_user: &str, session_cmd: &str) -> String { } /// The session command used as the default desktop for a profile. -pub fn default_session_command(profile: DesktopProfile) -> &'static str { - match profile { - DesktopProfile::Mango => "/usr/local/bin/phoebus-session-mango", - _ => "/usr/local/bin/phoebus-session", - } +pub fn default_session_command(_profile: DesktopProfile) -> &'static str { + "/usr/local/bin/phoebus-session-mango" } /// The live ISO's unprivileged user. @@ -1331,15 +1070,9 @@ pub fn desktop_asset(name: &str) -> Option { let live_cmd = "/usr/local/bin/phoebus-session-mango"; Some(match name { "session-mango" => PHOEBUS_MANGO_SESSION_SCRIPT.to_string(), - "session-dwl" => PHOEBUS_SESSION_SCRIPT.to_string(), "assistant" => PHOEBUS_ASSISTANT_SCRIPT.to_string(), "install" => PHOEBUS_INSTALL_SCRIPT.to_string(), "welcome" => PHOEBUS_WELCOME_SCRIPT.to_string(), - "menu" => PHOEBUS_MENU_SCRIPT.to_string(), - "lock" => PHOEBUS_LOCK_SCRIPT.to_string(), - "idle" => PHOEBUS_IDLE_SCRIPT.to_string(), - "waybar-config" => WAYBAR_CONFIG.to_string(), - "waybar-style" => WAYBAR_STYLE.to_string(), "mango-config" => MANGO_CONFIG_DEFAULT.to_string(), "mango-session-target" => MANGO_SESSION_TARGET.to_string(), "install-desktop" => PHOEBUS_INSTALL_DESKTOP_ENTRY.to_string(), @@ -1352,7 +1085,6 @@ pub fn desktop_asset(name: &str) -> Option { "nvidia-service" => PHOEBUS_NVIDIA_SERVICE.to_string(), "gpu-report" => PHOEBUS_GPU_REPORT_SCRIPT.to_string(), "wayland-session-mango" => wayland_session_entry(DesktopProfile::Mango)?.1, - "wayland-session-dwl" => wayland_session_entry(DesktopProfile::Dwl)?.1, // The brand system lives in `brand`; route the shared `--emit-asset` // plumbing through it so the live build has one source of assets. _ => return crate::brand::brand_asset(name), @@ -1649,7 +1381,7 @@ mod tests { #[test] fn desktop_includes_portals_for_flatpak_and_wayland() { - let pkgs = desktop_packages(DesktopProfile::Dwl); + let pkgs = desktop_packages(DesktopProfile::Mango); assert!(pkgs.contains(&"sys-apps/xdg-desktop-portal")); assert!(pkgs.contains(&"sys-apps/xdg-desktop-portal-gtk")); assert!(pkgs.contains(&"gui-libs/xdg-desktop-portal-wlr")); @@ -1662,7 +1394,7 @@ mod tests { cfg.desktop.profile = DesktopProfile::None; let text = package_use(&cfg, &crate::hardware::HardwareReport::default()); assert!(!text.contains("x11-libs/cairo X")); - cfg.desktop.profile = DesktopProfile::Dwl; + cfg.desktop.profile = DesktopProfile::Mango; let text = package_use(&cfg, &crate::hardware::HardwareReport::default()); assert!(text.contains("x11-libs/cairo X")); assert!(text.contains("media-libs/libglvnd X")); @@ -1692,7 +1424,7 @@ mod tests { #[test] fn package_use_is_clean_and_keeps_required_flags() { let mut cfg = InstallConfig::default(); - cfg.desktop.profile = DesktopProfile::Dwl; + cfg.desktop.profile = DesktopProfile::Mango; let text = package_use(&cfg, &crate::hardware::HardwareReport::default()); // Required boot/encryption/session flags stay. assert!(text.contains("sys-apps/systemd boot policykit cryptsetup")); @@ -1745,8 +1477,6 @@ mod tests { // An explicit `none` keeps the minimal systemd profile. cfg.desktop.profile = DesktopProfile::None; assert_eq!(selected_profile(&cfg), PROFILE_SYSTEMD_MINIMAL); - cfg.desktop.profile = DesktopProfile::Dwl; - assert_eq!(selected_profile(&cfg), PROFILE_SYSTEMD_DESKTOP); // An explicit non-default Gentoo profile is respected. cfg.stage3.gentoo_profile = "default/linux/amd64/23.0/hardened/systemd".into(); assert_eq!( @@ -1758,7 +1488,7 @@ mod tests { #[test] fn services_deduplicated() { let mut cfg = InstallConfig::default(); - cfg.desktop.profile = DesktopProfile::Full; + cfg.desktop.profile = DesktopProfile::Mango; let svcs = target_services(&cfg); assert!(svcs.contains(&"NetworkManager".to_string())); assert!(svcs.contains(&"bluetooth".to_string())); @@ -1766,59 +1496,6 @@ mod tests { assert_eq!(count, 1); } - #[test] - fn session_script_is_race_free_and_cleans_up() { - let script = PHOEBUS_SESSION_SCRIPT; - // The compositor starts before the clients and the clients wait for - // the socket it creates. - let dwl = script.find("dwl &").expect("starts dwl in the background"); - let socket_wait = script - .find("while [ ! -S \"$socket\" ]") - .expect("waits for the wayland socket"); - let waybar = script.find("start_helper waybar").expect("starts waybar"); - assert!(dwl < socket_wait && socket_wait < waybar); - // A session bus and runtime dir are established. - assert!(script.contains("dbus-run-session")); - assert!(script.contains("XDG_RUNTIME_DIR")); - // The polkit agent is started when present. - assert!(script.contains("POLKIT_AGENT")); - // Helpers are reaped when the compositor exits. - assert!(script.contains("cleanup()")); - assert!(script.contains("trap cleanup EXIT INT TERM")); - assert!(script.contains("wait \"$DWL_PID\"")); - assert!(!script.contains("exec dwl")); - // Idle handling starts with the session. - assert!(script.contains("start_helper phoebus-idle")); - } - - #[test] - fn desktop_helpers_cover_launch_lock_idle_and_power() { - let menu = PHOEBUS_MENU_SCRIPT; - assert!(menu.contains("wofi --show drun")); - for action in ["Lock", "Suspend", "Log out", "Reboot", "Shut down"] { - assert!(menu.contains(action), "power menu missing {action}"); - } - assert!(menu.contains("systemctl suspend")); - assert!(menu.contains("systemctl reboot")); - assert!(menu.contains("systemctl poweroff")); - assert!(menu.contains("pkill -TERM dwl")); - - assert!(PHOEBUS_LOCK_SCRIPT.contains("swaylock -f")); - assert!(PHOEBUS_IDLE_SCRIPT.contains("swayidle")); - assert!(PHOEBUS_IDLE_SCRIPT.contains("before-sleep 'phoebus-lock'")); - assert!(PHOEBUS_IDLE_SCRIPT.contains("systemctl suspend")); - - // Network and audio controls are present and actionable. - let waybar = WAYBAR_CONFIG; - assert!(waybar.contains("\"wireplumber\"")); - assert!(waybar.contains("\"network\"")); - assert!(waybar.contains("nm-connection-editor")); - assert!(waybar.contains("custom/power")); - assert!(waybar.contains("phoebus-menu --power")); - assert!(waybar.contains("battery")); - assert!(waybar.contains("clock")); - } - #[test] fn encrypted_cmdline_requires_uuid() { let cfg = InstallConfig::default(); @@ -1827,15 +1504,20 @@ mod tests { } #[test] - fn mango_profile_selects_guru_stack_and_keeps_dwl_fallback() { + fn mango_profile_selects_guru_stack() { let pkgs = desktop_packages(DesktopProfile::Mango); assert!(pkgs.contains(&"gui-wm/mangowm")); assert!(pkgs.contains(&"gui-apps/dankmaterialshell")); assert!(pkgs.contains(&"gui-apps/danksearch")); assert!(pkgs.contains(&"dev-vcs/git")); - // The dwl compositor and helpers remain as a fallback. - assert!(pkgs.contains(&"gui-wm/dwl")); - assert!(pkgs.contains(&"gui-apps/waybar")); + // Standalone dwl and helpers must not be present. + assert!(!pkgs.contains(&"gui-wm/dwl")); + assert!(!pkgs.contains(&"gui-apps/waybar")); + assert!(!pkgs.contains(&"gui-apps/wofi")); + assert!(!pkgs.contains(&"gui-apps/mako")); + assert!(!pkgs.contains(&"gui-apps/swaybg")); + assert!(!pkgs.contains(&"gui-apps/swayidle")); + assert!(!pkgs.contains(&"gui-apps/swaylock")); // Portals and the shared Wayland stack are present. assert!(pkgs.contains(&"sys-apps/xdg-desktop-portal-gtk")); assert!(pkgs.contains(&"gui-libs/xdg-desktop-portal-wlr")); @@ -1953,8 +1635,8 @@ mod tests { "/usr/local/bin/phoebus-session-mango" ); assert_eq!( - default_session_command(DesktopProfile::Dwl), - "/usr/local/bin/phoebus-session" + default_session_command(DesktopProfile::None), + "/usr/local/bin/phoebus-session-mango" ); } @@ -1985,9 +1667,8 @@ mod tests { assert!(desktop_asset("greetd-installed") .unwrap() .contains("phoebus-session-mango")); - assert!(desktop_asset("wayland-session-dwl") - .unwrap() - .contains("phoebus-session")); + assert!(desktop_asset("wayland-session-dwl").is_none()); + assert!(desktop_asset("session-dwl").is_none()); assert!(desktop_asset("install-desktop") .unwrap() .contains("Install Phoebus")); diff --git a/installer-rs/crates/phoebus-executor/src/desktop.rs b/installer-rs/crates/phoebus-executor/src/desktop.rs index 96c16fc..9744b33 100644 --- a/installer-rs/crates/phoebus-executor/src/desktop.rs +++ b/installer-rs/crates/phoebus-executor/src/desktop.rs @@ -1,7 +1,7 @@ //! Desktop profile installation. //! -//! The flagship desktop is a small Wayland tiling environment centred on dwl, -//! with PipeWire/WirePlumber audio. Flatpak is supported out of the box. +//! The Phoebus desktop is Mango (wlroots tiling compositor) + DarkMaterial +//! (DankMaterialShell), with PipeWire/WirePlumber audio. Flatpak is supported out of the box. use std::path::Path; @@ -50,13 +50,7 @@ pub fn install( ) } -/// Write `/usr/local/bin/phoebus-session`, a clear manual entry point for the -/// Wayland desktop. It starts the supporting daemons and then execs dwl. -/// -/// Hotkeys (dwl defaults, Phoebus patches may add more): -/// Mod+Shift+Return terminal Mod+d launcher -/// Mod+Shift+q close window Mod+j / Mod+k focus next/prev -/// Mod+1..9 workspace Mod+Shift+e quit dwl +/// Write `/usr/local/bin/phoebus-session-mango` and the wrapper `/usr/local/bin/phoebus-session`. pub fn write_session_script(exec: &Exec, config: &InstallConfig) -> Result<()> { if config.desktop.profile == DesktopProfile::None { return Ok(()); @@ -78,70 +72,24 @@ pub fn write_session_script(exec: &Exec, config: &InstallConfig) -> Result<()> { match config.desktop.profile { DesktopProfile::Mango => { write_mango_session(exec, &target)?; - // The dwl session stays installed as a fallback. - write_dwl_session(exec, &target)?; } - DesktopProfile::Dwl | DesktopProfile::Full => { - write_dwl_session(exec, &target)?; - } - // Minimal has no session entry point. - _ => {} + DesktopProfile::None => {} } Ok(()) } -fn write_dwl_session(exec: &Exec, target: &phoebus_core::TargetRoot) -> Result<()> { - let script = sysgen::PHOEBUS_SESSION_SCRIPT; - let path = target.resolve("usr/local/bin/phoebus-session")?; - target.write("usr/local/bin/phoebus-session", script)?; - use std::os::unix::fs::PermissionsExt; - std::fs::set_permissions(&path, std::fs::Permissions::from_mode(0o755)) - .map_err(|e| ExecError::io(path.clone(), e))?; - if !path.is_file() { - return Err(ExecError::operation( - "desktop", - "write session script", - format!("session script missing after write: {}", path.display()), - )); - } - - // Launcher/power menu, screen locker and idle daemon. Installing these (and - // the Waybar configuration below) completes the discoverable desktop: a - // user can launch apps, control network/audio, lock and suspend without - // editing configuration by hand. - write_script( - &target, - "usr/local/bin/phoebus-menu", - sysgen::PHOEBUS_MENU_SCRIPT, - )?; - write_script( - &target, - "usr/local/bin/phoebus-lock", - sysgen::PHOEBUS_LOCK_SCRIPT, - )?; - write_script( - &target, - "usr/local/bin/phoebus-idle", - sysgen::PHOEBUS_IDLE_SCRIPT, - )?; - target.write("etc/xdg/waybar/config", sysgen::WAYBAR_CONFIG)?; - target.write("etc/xdg/waybar/style.css", sysgen::WAYBAR_STYLE)?; - if let Some((name, entry)) = sysgen::wayland_session_entry(DesktopProfile::Dwl) { - target.write(&format!("usr/share/wayland-sessions/{name}"), entry)?; - } - exec.logger.info(format!( - "wrote /usr/local/bin/phoebus-session ({})", - path.display() - )); - Ok(()) -} - fn write_mango_session(exec: &Exec, target: &phoebus_core::TargetRoot) -> Result<()> { write_script( target, "usr/local/bin/phoebus-session-mango", sysgen::PHOEBUS_MANGO_SESSION_SCRIPT, )?; + // Convenience wrapper so manual VT invocation launches the canonical session. + write_script( + target, + "usr/local/bin/phoebus-session", + "#!/bin/bash\nexec /usr/local/bin/phoebus-session-mango \"$@\"\n", + )?; target.write("etc/xdg/mango/config.conf", sysgen::MANGO_CONFIG_DEFAULT)?; target.write( "usr/lib/systemd/user/mango-session.target", @@ -272,61 +220,6 @@ mod tests { Exec::new(Box::new(runner), logger, false, path.join("root"), path) } - #[test] - fn session_script_waits_for_the_socket_and_starts_polkit() { - let runner = RecordingRunner::new(); - let exec = make_exec(runner); - let mut cfg = InstallConfig::default(); - cfg.desktop.profile = DesktopProfile::Dwl; - write_session_script(&exec, &cfg).unwrap(); - let path = exec.root.join("usr/local/bin/phoebus-session"); - let text = std::fs::read_to_string(&path).unwrap(); - // dwl is started first and waited on; helpers wait for the socket. - assert!(text.contains("dwl &")); - assert!(text.contains("wait \"$DWL_PID\"")); - assert!(!text.contains("exec dwl"), "exec would skip helper cleanup"); - assert!(text.contains("wayland-0")); - assert!(text.contains("polkit-gnome-authentication-agent-1")); - assert!(text.contains("start_helper waybar")); - assert!(text.contains("trap cleanup EXIT INT TERM")); - use std::os::unix::fs::PermissionsExt; - assert_ne!( - std::fs::metadata(&path).unwrap().permissions().mode() & 0o111, - 0 - ); - } - - #[test] - fn session_helpers_and_waybar_config_are_installed() { - let runner = RecordingRunner::new(); - let exec = make_exec(runner); - let mut cfg = InstallConfig::default(); - cfg.desktop.profile = DesktopProfile::Dwl; - write_session_script(&exec, &cfg).unwrap(); - for rel in [ - "usr/local/bin/phoebus-menu", - "usr/local/bin/phoebus-lock", - "usr/local/bin/phoebus-idle", - "etc/xdg/waybar/config", - "etc/xdg/waybar/style.css", - ] { - let path = exec.root.join(rel); - assert!(path.is_file(), "{rel} was not installed"); - } - use std::os::unix::fs::PermissionsExt; - for rel in [ - "usr/local/bin/phoebus-menu", - "usr/local/bin/phoebus-lock", - "usr/local/bin/phoebus-idle", - ] { - let mode = std::fs::metadata(exec.root.join(rel)) - .unwrap() - .permissions() - .mode(); - assert_ne!(mode & 0o111, 0, "{rel} must be executable"); - } - } - #[test] fn no_session_script_for_none_profile() { let runner = RecordingRunner::new(); @@ -335,12 +228,16 @@ mod tests { cfg.desktop.profile = DesktopProfile::None; write_session_script(&exec, &cfg).unwrap(); assert!(!exec.root.join("usr/local/bin/phoebus-session").exists()); + assert!(!exec + .root + .join("usr/local/bin/phoebus-session-mango") + .exists()); // An explicit `none` also writes no assistant launcher. assert!(!exec.root.join("usr/local/bin/phoebus-assistant").exists()); } #[test] - fn mango_profile_installs_both_sessions_and_no_dwl_helpers_in_mango() { + fn mango_profile_installs_canonical_session_and_no_dwl_artifacts() { let runner = RecordingRunner::new(); let exec = make_exec(runner); let mut cfg = InstallConfig::default(); @@ -353,10 +250,20 @@ mod tests { "etc/xdg/mango/config.conf", "usr/lib/systemd/user/mango-session.target", "usr/share/wayland-sessions/phoebus-mango.desktop", - "usr/share/wayland-sessions/phoebus-dwl.desktop", ] { assert!(exec.root.join(rel).is_file(), "{rel} was not installed"); } + // Standalone dwl session entry and helpers must NOT be installed. + for rel in [ + "usr/share/wayland-sessions/phoebus-dwl.desktop", + "usr/local/bin/phoebus-menu", + "usr/local/bin/phoebus-lock", + "usr/local/bin/phoebus-idle", + "etc/xdg/waybar/config", + "etc/xdg/waybar/style.css", + ] { + assert!(!exec.root.join(rel).exists(), "{rel} must not be installed"); + } let mango = std::fs::read_to_string(exec.root.join("usr/local/bin/phoebus-session-mango")).unwrap(); for helper in ["waybar", "mako", "swaybg", "swayidle", "swaylock"] { @@ -366,10 +273,15 @@ mod tests { ); } assert!(mango.contains("dms run") || mango.contains("mango-session.target")); - let dwl = std::fs::read_to_string(exec.root.join("usr/local/bin/phoebus-session")).unwrap(); + let session = + std::fs::read_to_string(exec.root.join("usr/local/bin/phoebus-session")).unwrap(); assert!( - dwl.contains("dwl &"), - "dwl fallback session must be present" + session.contains("phoebus-session-mango"), + "phoebus-session wrapper must invoke phoebus-session-mango" + ); + assert!( + !session.contains("dwl &"), + "standalone dwl must not be in phoebus-session" ); } diff --git a/installer-rs/crates/phoebus-executor/tests/session_script.rs b/installer-rs/crates/phoebus-executor/tests/session_script.rs index a5b32c6..bd1c438 100644 --- a/installer-rs/crates/phoebus-executor/tests/session_script.rs +++ b/installer-rs/crates/phoebus-executor/tests/session_script.rs @@ -1,14 +1,14 @@ -//! Functional test of the generated `phoebus-session` script. +//! Functional test of the generated `phoebus-session-mango` script. //! -//! Runs the real script against stub `dwl`/helper binaries so the startup -//! ordering, the Wayland-socket wait, the polkit agent and helper cleanup are +//! Runs the real script against stub `mango`/`dms` binaries so the startup +//! ordering, the Wayland-socket discovery, DMS launch, and helper cleanup are //! exercised without a physical seat or a Wayland compositor. use std::path::Path; use std::process::{Child, Command, Stdio}; use std::time::{Duration, Instant}; -use phoebus_core::system::PHOEBUS_SESSION_SCRIPT; +use phoebus_core::system::PHOEBUS_MANGO_SESSION_SCRIPT; fn write_exec(path: &Path, body: &str) { std::fs::write(path, body).unwrap(); @@ -16,22 +16,21 @@ fn write_exec(path: &Path, body: &str) { std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o755)).unwrap(); } -/// dwl stub: creates a real unix socket at $XDG_RUNTIME_DIR/wayland-0 and exits +/// mango stub: creates a real unix socket at $XDG_RUNTIME_DIR/wayland-0 and exits /// after a moment so the session ends. -const DWL_OK: &str = r#"#!/bin/sh -echo dwl-started >> "$SESSION_TEST_DIR/dwl.log" +const MANGO_OK: &str = r#"#!/bin/sh +echo mango-started >> "$SESSION_TEST_DIR/mango.log" exec python3 -c 'import os,socket,time; s=socket.socket(socket.AF_UNIX); s.bind(os.path.join(os.environ["XDG_RUNTIME_DIR"],"wayland-0")); s.listen(1); time.sleep(3)' "#; -/// dwl stub that fails before creating the socket. -const DWL_FAIL: &str = "#!/bin/sh\nexit 1\n"; +/// mango stub that fails before creating the socket. +const MANGO_FAIL: &str = "#!/bin/sh\nexit 1\n"; -/// Helper stub: records whether the Wayland socket existed when it started, +/// DMS stub: records whether the Wayland socket existed when it started, /// stores its pid, then sleeps so cleanup has something to kill. -const HELPER: &str = r#"#!/bin/sh -name="$(basename "$0")" +const DMS_STUB: &str = r#"#!/bin/sh if [ -S "$XDG_RUNTIME_DIR/wayland-0" ]; then s=ok; else s=missing; fi -echo "$name $s" >> "$SESSION_TEST_DIR/helpers.log" +echo "dms $s wayland_display=${WAYLAND_DISPLAY:-missing}" >> "$SESSION_TEST_DIR/helpers.log" echo $$ >> "$SESSION_TEST_DIR/helper-pids" exec sleep 30 "#; @@ -58,23 +57,16 @@ struct Fixture { } impl Fixture { - fn new(dwl_body: &str) -> Self { + fn new(mango_body: &str) -> Self { let dir = tempfile::tempdir().unwrap(); let bin = dir.path().join("bin"); let runtime = dir.path().join("runtime"); std::fs::create_dir_all(&bin).unwrap(); std::fs::create_dir_all(&runtime).unwrap(); - let script = dir.path().join("phoebus-session"); - write_exec(&script, PHOEBUS_SESSION_SCRIPT); - write_exec(&bin.join("dwl"), dwl_body); - for helper in [ - "waybar", - "mako", - "swaybg", - "polkit-gnome-authentication-agent-1", - ] { - write_exec(&bin.join(helper), HELPER); - } + let script = dir.path().join("phoebus-session-mango"); + write_exec(&script, PHOEBUS_MANGO_SESSION_SCRIPT); + write_exec(&bin.join("mango"), mango_body); + write_exec(&bin.join("dms"), DMS_STUB); Self { dir, script, @@ -114,26 +106,26 @@ impl Fixture { #[test] fn helpers_wait_for_the_socket_and_are_reaped() { - let fixture = Fixture::new(DWL_OK); + let fixture = Fixture::new(MANGO_OK); let (status, stderr) = fixture.run(); assert!(status.success(), "session failed: {stderr}"); - // Every helper observed the socket: they did not race the compositor. + // Mango started and DMS observed the socket and exported WAYLAND_DISPLAY. + let mango_log = fixture.read("mango.log"); + assert!(mango_log.contains("mango-started")); + let log = fixture.read("helpers.log"); - for name in [ - "waybar", - "mako", - "swaybg", - "polkit-gnome-authentication-agent-1", - ] { - assert!(log.contains(&format!("{name} ok")), "helper log: {log:?}"); - } + assert!(log.contains("dms ok"), "helper log: {log:?}"); + assert!( + log.contains("wayland_display=wayland-0"), + "helper log: {log:?}" + ); assert!( !log.contains("missing"), "a helper raced the socket: {log:?}" ); - // The helpers were killed when dwl exited (logout leaves nothing behind). + // The helpers were killed when mango exited (logout leaves nothing behind). let pids = fixture.read("helper-pids"); assert!(!pids.trim().is_empty(), "no helper pids recorded"); std::thread::sleep(Duration::from_millis(300)); @@ -147,9 +139,12 @@ fn helpers_wait_for_the_socket_and_are_reaped() { #[test] fn failure_to_create_the_socket_is_reported() { - let fixture = Fixture::new(DWL_FAIL); + let fixture = Fixture::new(MANGO_FAIL); let (status, stderr) = fixture.run(); assert!(!status.success(), "a dead compositor must fail the session"); - assert!(stderr.contains("dwl exited before creating"), "{stderr}"); + assert!( + stderr.contains("mango exited before creating a Wayland socket"), + "{stderr}" + ); assert!(fixture.read("helpers.log").is_empty()); } diff --git a/installer-rs/crates/phoebus-installer/src/orchestrate.rs b/installer-rs/crates/phoebus-installer/src/orchestrate.rs index b6af897..f786ab4 100644 --- a/installer-rs/crates/phoebus-installer/src/orchestrate.rs +++ b/installer-rs/crates/phoebus-installer/src/orchestrate.rs @@ -844,16 +844,7 @@ impl Installer { )); } } - DesktopProfile::Dwl | DesktopProfile::Full => { - if !target.exists("usr/local/bin/phoebus-session") { - return Err(phoebus_executor::ExecError::operation( - "finalize", - "verify target", - "session script /usr/local/bin/phoebus-session missing", - )); - } - } - _ => {} + DesktopProfile::None => {} } if !target.exists("etc/greetd/config.toml") { diff --git a/installer-rs/crates/phoebus-installer/tests/golden/plan.txt b/installer-rs/crates/phoebus-installer/tests/golden/plan.txt index cccbea4..5a51e89 100644 --- a/installer-rs/crates/phoebus-installer/tests/golden/plan.txt +++ b/installer-rs/crates/phoebus-installer/tests/golden/plan.txt @@ -40,7 +40,8 @@ Software: Package policy : balanced Binary pkgs : yes Accept license : @FREE @BINARY-REDISTRIBUTABLE - Desktop : dwl + Desktop : mango + Session : Mango + DankMaterialShell (GURU overlay) Flatpak : yes Audio : pipewire AI assistant : no diff --git a/installer-rs/crates/phoebus-installer/tests/live_iso.rs b/installer-rs/crates/phoebus-installer/tests/live_iso.rs index 63ed791..e86c9a7 100644 --- a/installer-rs/crates/phoebus-installer/tests/live_iso.rs +++ b/installer-rs/crates/phoebus-installer/tests/live_iso.rs @@ -163,12 +163,11 @@ fn live_login_autologins_and_the_configs_are_separate() { } #[test] -fn both_session_entries_are_shipped_for_the_fallback() { +fn only_mango_session_entry_is_shipped() { let mango = system::desktop_asset("wayland-session-mango").unwrap(); - let dwl = system::desktop_asset("wayland-session-dwl").unwrap(); assert!(mango.contains("Exec=/usr/local/bin/phoebus-session-mango")); - assert!(dwl.contains("Exec=/usr/local/bin/phoebus-session")); - assert_ne!(mango, dwl); + assert!(system::desktop_asset("wayland-session-dwl").is_none()); + assert!(system::desktop_asset("session-dwl").is_none()); } #[test] @@ -180,13 +179,13 @@ fn default_config_omits_to_mango_and_overrides_are_respected() { assert!(InstallConfig::default().desktop.flatpak); for (value, expected) in [ ("none", DesktopProfile::None), - ("dwl", DesktopProfile::Dwl), - ("full", DesktopProfile::Full), ("mango", DesktopProfile::Mango), ] { let cfg = InstallConfig::from_legacy(&format!("DESKTOP_PROFILE='{value}'\n")).unwrap(); assert_eq!(cfg.desktop.profile, expected); } + // Standalone dwl is obsolete and rejected. + assert!(InstallConfig::from_legacy("DESKTOP_PROFILE='dwl'\n").is_err()); } #[test] diff --git a/installer-rs/crates/phoebus-installer/tests/plan_golden.rs b/installer-rs/crates/phoebus-installer/tests/plan_golden.rs index a902a40..ca7bcce 100644 --- a/installer-rs/crates/phoebus-installer/tests/plan_golden.rs +++ b/installer-rs/crates/phoebus-installer/tests/plan_golden.rs @@ -23,7 +23,7 @@ COMPRESS='zstd:3'\n\ KERNEL_PROFILE='safe'\n\ KERNEL_CONSOLE='console=tty0'\n\ PACKAGE_POLICY='balanced'\n\ -DESKTOP_PROFILE='dwl'\n\ +DESKTOP_PROFILE='mango'\n\ BTRFS_SUBVOLS='@ @home @var @snapshots @swap'\n"; fn sample_config() -> InstallConfig { diff --git a/installer-rs/crates/phoebus-tui/src/lib.rs b/installer-rs/crates/phoebus-tui/src/lib.rs index 860f495..8d30b37 100644 --- a/installer-rs/crates/phoebus-tui/src/lib.rs +++ b/installer-rs/crates/phoebus-tui/src/lib.rs @@ -392,11 +392,8 @@ fn choice_options(choice: Choice, _config: &InstallConfig) -> Vec { PackagePolicy::BinaryFirst.to_string(), ], Choice::DesktopProfile => vec![ - DesktopProfile::None.to_string(), - DesktopProfile::Dwl.to_string(), DesktopProfile::Mango.to_string(), - DesktopProfile::Minimal.to_string(), - DesktopProfile::Full.to_string(), + DesktopProfile::None.to_string(), ], Choice::AiProvider => vec!["none".into(), "deepseek".into(), "openai".into()], } @@ -444,13 +441,7 @@ fn apply_choice(choice: Choice, index: usize, config: &mut InstallConfig) { ][index.min(2)]; } Choice::DesktopProfile => { - config.desktop.profile = [ - DesktopProfile::None, - DesktopProfile::Dwl, - DesktopProfile::Mango, - DesktopProfile::Minimal, - DesktopProfile::Full, - ][index.min(4)]; + config.desktop.profile = [DesktopProfile::Mango, DesktopProfile::None][index.min(1)]; } Choice::AiProvider => { let provider = ["none", "deepseek", "openai"][index.min(2)]; @@ -617,7 +608,9 @@ mod tests { fn apply_choice_sets_values() { let mut config = InstallConfig::default(); apply_choice(Choice::DesktopProfile, 1, &mut config); - assert_eq!(config.desktop.profile, DesktopProfile::Dwl); + assert_eq!(config.desktop.profile, DesktopProfile::None); + apply_choice(Choice::DesktopProfile, 0, &mut config); + assert_eq!(config.desktop.profile, DesktopProfile::Mango); apply_choice(Choice::Encryption, 1, &mut config); assert_eq!(config.encryption.mode, Encryption::None); } diff --git a/installer/live/README.md b/installer/live/README.md index 1e39fd7..bd6b8ad 100644 --- a/installer/live/README.md +++ b/installer/live/README.md @@ -91,7 +91,6 @@ launcher is missing; it never silently emits a text-only ISO. `live-sudoers`, installed to `/etc/sudoers.d/90-phoebus-live` and validated with `visudo` at build time. The password-authenticated recovery console is deliberate and preserved. -- The `phoebus-dwl` session remains selectable as a fallback. ## NVIDIA accelerated graphics @@ -162,6 +161,6 @@ UEFI VM: `gui` (welcome + wizard journey and screenshots), `install` ## Installed system -An installed system always authenticates through `greetd` and defaults to the -Mango session, with dwl selectable. Automatic login is **live-only** and is +An installed system always authenticates through `greetd` and starts the +Mango + DarkMaterial session. Automatic login is **live-only** and is never copied to the installed system; see ADR 0009. diff --git a/installer/live/build.sh b/installer/live/build.sh index 0179595..511235e 100755 --- a/installer/live/build.sh +++ b/installer/live/build.sh @@ -99,10 +99,9 @@ echo "releases OK" # --------------------------------------------------------------------------- say "emit shared desktop assets" assets=( - session-mango session-dwl assistant install welcome menu lock idle + session-mango assistant install welcome mango-config mango-session-target install-desktop - wayland-session-mango wayland-session-dwl - waybar-config waybar-style greetd-live live-sudoers + wayland-session-mango greetd-live live-sudoers brand-emblem brand-wordmark brand-wallpaper brand-tokens nvidia-load nvidia-service gpu-report ) @@ -239,20 +238,14 @@ install_asset() { } install_asset session-mango /usr/local/bin/phoebus-session-mango 0755 -install_asset session-dwl /usr/local/bin/phoebus-session 0755 +ln -sf phoebus-session-mango "$rootfs/usr/local/bin/phoebus-session" install_asset assistant /usr/local/bin/phoebus-assistant 0755 install_asset install /usr/local/bin/phoebus-install 0755 install_asset welcome /usr/local/bin/phoebus-welcome 0755 -install_asset menu /usr/local/bin/phoebus-menu 0755 -install_asset lock /usr/local/bin/phoebus-lock 0755 -install_asset idle /usr/local/bin/phoebus-idle 0755 install_asset mango-config /etc/xdg/mango/config.conf install_asset mango-session-target /usr/lib/systemd/user/mango-session.target install_asset install-desktop /usr/share/applications/phoebus-install.desktop install_asset wayland-session-mango /usr/share/wayland-sessions/phoebus-mango.desktop -install_asset wayland-session-dwl /usr/share/wayland-sessions/phoebus-dwl.desktop -install_asset waybar-config /etc/xdg/waybar/config -install_asset waybar-style /etc/xdg/waybar/style.css # Live-only automatic login (never copied to an installed system). install_asset greetd-live /etc/greetd/config.toml diff --git a/installer/tests/vm/test.conf.example b/installer/tests/vm/test.conf.example index db764c7..b4c40b7 100644 --- a/installer/tests/vm/test.conf.example +++ b/installer/tests/vm/test.conf.example @@ -27,8 +27,8 @@ KEEP_KERNELS='3' PACKAGE_POLICY='balanced' FEATURES_BINPKG='yes' -# mango = default desktop (Mango + DankMaterialShell + dwl fallback); -# none/dwl/minimal/full override it. Omitting the key selects mango. +# mango = canonical desktop (Mango + DarkMaterial); +# none overrides it. Omitting the key selects mango. DESKTOP_PROFILE='mango' FLATPAK='yes'