feat(desktop): streamline installer UX and add DWM keybindings
Some checks are pending
ci / test (push) Waiting to run
Some checks are pending
ci / test (push) Waiting to run
- Add canonical DWM / DWL keybindings to MANGO_CONFIG_DEFAULT (Mod+Shift+Return terminal, Mod+Return zoom, Mod+j/k focusstack, Mod+Shift+j/k movestack, Mod+h/l setmfact, Mod+i/d incnmaster, Mod+Shift+c/q killclient, Mod+t/m/f layouts, Mod+Shift+Space float toggle, Mod+Tab view previous, Mod+1..9 tags, Mod+Shift+1..9 movetotag, mouse window drag/resize) - Close Welcome window on installer launch to allow full-screen tiling - Rewrite PhoebusCombo into a scrollable dropdown with search and vertical scrollbar - Parse XKB rules (evdev.lst / base.lst) for standard desktop keyboard layouts - Streamline installer defaults: lock to Mango + DankMaterialShell, Btrfs with snapshots, and Nix + Flatpak enabled (removing confusing manual choices) - Simplify Account step: username only, single password with disk encryption toggle, and remove artificial 8-character password length limit - Direct installation confirmation without typing ERASE or ticking confirmation box - Fix live progress log details view with a dedicated scrollable log box and 1.5s timer
This commit is contained in:
parent
1106bcaa0a
commit
3515f1cf12
10 changed files with 845 additions and 406 deletions
|
|
@ -5,6 +5,42 @@ this file is the curated, human-readable summary.
|
|||
|
||||
Format: Keep a Changelog. Dates are UTC.
|
||||
|
||||
## 2026-09-22 — Installer UX streamlining and DWM keybindings in Mango
|
||||
|
||||
- **DWM / DWL keybindings in Mango:** Packaged `MANGO_CONFIG_DEFAULT` now ships
|
||||
with standard dwm / dwl bindings for tiling and window management:
|
||||
`Mod+Shift+Return` (terminal), `Mod+Return` (zoom / promote to master),
|
||||
`Mod+j`/`Mod+k` (focus stack next/prev), `Mod+Shift+j`/`Mod+Shift+k` (exchange
|
||||
client), `Mod+h`/`Mod+l` (`setmfact` master area sizing), `Mod+i`/`Mod+d`
|
||||
(`incnmaster` master count), `Mod+Shift+c`/`Mod+Shift+q` (`killclient`),
|
||||
`Mod+t`/`Mod+m`/`Mod+f` (tile, monocle, fullscreen), `Mod+Shift+Space` (toggle
|
||||
floating), `Mod+Tab` (view previous tag), `Mod+1..9` (tag switching),
|
||||
`Mod+Shift+1..9` (tag moving), and `Mod+left/right/middle click` for window
|
||||
dragging, resizing and floating toggling.
|
||||
- **Full-screen installer window:** Closing the Welcome window when starting the
|
||||
installer allows Mango's tiling layout to present the installer full-screen.
|
||||
- **Scrollable dropdown menus:** Replaced the combo box with `PhoebusCombo`, a
|
||||
true dropdown menu with a clickable chevron, instant search filtering, and a
|
||||
scrollable `ListView` with vertical scrollbar that handles large lists without
|
||||
cutting off choices or destroying pre-filled selections.
|
||||
- **Desktop keyboard layouts:** Keyboard options now parse XKB rules
|
||||
(`/usr/share/X11/xkb/rules/evdev.lst` and `base.lst`) for clean desktop
|
||||
layouts with human-readable labels, replacing the ancient console keymap tree.
|
||||
- **Streamlined defaults:** Removed the manual desktop profile selector,
|
||||
filesystem selector, and Nix/Flatpak toggles from the UI; the installer now
|
||||
consistently defaults to Mango + DankMaterialShell, Btrfs with snapshots, and
|
||||
both Flatpak and Nix enabled.
|
||||
- **Account & password simplification:** Removed the redundant "Full name" field
|
||||
(username only). Removed the artificial 8-character password length limit. Added
|
||||
a "Use same password to encrypt disk" toggle (enabled by default) so users do
|
||||
not have to re-enter a separate disk passphrase across four fields.
|
||||
- **Direct confirmation:** Removed typing "ERASE" and the confirmation checkbox
|
||||
from the review screen; the overview screen clearly highlights the target disk
|
||||
and clicking "Install now" proceeds directly.
|
||||
- **Live progress log details:** The "Show details" button during installation
|
||||
now opens a dedicated scrollable log viewer that polls every 1.5 seconds and
|
||||
auto-scrolls to the newest output.
|
||||
|
||||
## 2026-09-22 — Event-driven analysis of a first-time user's journey
|
||||
|
||||
The graphical installer was audited against a first-time user's journey and
|
||||
|
|
|
|||
|
|
@ -3,27 +3,21 @@
|
|||
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-22), graphical installer journey
|
||||
polish and reliability.
|
||||
- **Current focus:** Reworked the graphical installer into a fixed,
|
||||
first-time-user journey — Welcome, Language and keyboard, Internet and
|
||||
readiness, AI connection, Destination disk, Account and encryption, Review
|
||||
and confirmation, Installation, Completion — while keeping configuration,
|
||||
validation, plans, approval and execution authoritative in Rust. Fixed the
|
||||
interaction defects called out in the audit: the readiness refresh no longer
|
||||
resets the wizard; model catalogs are fetched after syncing the edited
|
||||
settings/credentials and stale replies are ignored; editing a connection
|
||||
field invalidates the validated state; suggestion lists have full keyboard
|
||||
navigation; the keyboard step is labelled truthfully (the live session keeps
|
||||
its layout); readiness separates a local link from reachable install services;
|
||||
and every busy state now clears on failure with an actionable retry (the
|
||||
bridge fails outstanding requests when the backend exits). AI changes require
|
||||
an explicit Accept or Discard; the review screen is built from backend facts
|
||||
with edit links; progress reports real stages, elapsed time and activity.
|
||||
- **Last updated:** this session (2026-09-22), installer UX streamlining and DWM keybindings.
|
||||
- **Current focus:** Overhauled the graphical installer's defaults and usability based on live user testing:
|
||||
1. Welcome window closes upon clicking "Install Phoebus OS" so the installer runs full-screen in Mango's tiling layout.
|
||||
2. Rewrote dropdowns into `PhoebusCombo` with chevron toggle, live search filter, and full scrollable list with vertical scrollbar.
|
||||
3. Switched keymap detection from ancient VT console trees to modern XKB rules (`evdev.lst`/`base.lst`) with human-readable labels, and filtered locales for clean UTF-8.
|
||||
4. Removed "Test the live keyboard" card.
|
||||
5. Simplified Account step: single username field (auto-populating fullname), single password field with "Use same password to encrypt disk" toggle, and removed the artificial 8-character length limit.
|
||||
6. Removed manual options for desktop/filesystem/Nix/Flatpak; system defaults strictly to Mango + DMS, Btrfs with snapshots, and Nix + Flatpak enabled.
|
||||
7. Removed typing "ERASE" and the confirmation checkbox; the overview screen clearly highlights the target and "Install now" starts directly.
|
||||
8. Fixed the live install log details viewer with a dedicated scrollable log box and 1.5s refresh timer.
|
||||
9. Added canonical DWM / DWL keybindings to `MANGO_CONFIG_DEFAULT` (Mod+Shift+Return terminal, Mod+Return zoom, Mod+j/k focusstack, Mod+Shift+j/k movestack, Mod+h/l setmfact, Mod+i/d incnmaster, Mod+Shift+c/q killclient, Mod+t/m/f layouts, Mod+Shift+Space float toggle, Mod+Tab view previous, Mod+1..9 tags, Mod+Shift+1..9 movetotag, mouse window drag/resize).
|
||||
- **Last verified (this session):**
|
||||
- `cargo fmt --all -- --check` and `cargo clippy --workspace --all-targets`
|
||||
clean (only the pre-existing `result_large_err` advisory); the Rust
|
||||
workspace tests pass and `make test` (Rust + 16 harness tests) is green.
|
||||
- `cargo fmt --all -- --check`, `cargo clippy --workspace --all-targets` (clean, 0 errors).
|
||||
- `cargo test --workspace` all tests passing (0 failures).
|
||||
- Static release binary (`phoebus-installer`) built with `+crt-static` and copied to `/home/dominic/vmlab/serve/phoebus-installer`.
|
||||
- Disposable graphical VM, rebuilt ISO
|
||||
(`sha256 125d002b…`, 1.6 GiB): `gui` **28/28** PASS and `opencode` **18/18**
|
||||
PASS, including the keyboard-suggestion regression, the blocked AI gate,
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ this closed set of actions, each with a non-empty reason and optional evidence:
|
|||
set_hostname, set_timezone, set_locale, set_keymap, set_username, set_target_disk,
|
||||
set_filesystem (btrfs|ext4), set_encryption (none|luks2), set_kernel_profile
|
||||
(safe|optimized|aggressive), set_package_policy (balanced|source_first|binary_first),
|
||||
set_desktop_profile (none|minimal|dwl|full), set_flatpak (bool),
|
||||
set_desktop_profile (mango), set_flatpak (bool),
|
||||
set_binary_packages (bool), set_build_jobs (1-256), set_package_use (atom, flag,
|
||||
enabled).
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ option in `value`; never use the action name as a key. Correct examples:
|
|||
Rules: prefer stability and a proven boot over speculative performance; never
|
||||
propose disabling signature verification, enabling ~amd64 globally, weakening
|
||||
LUKS2/Btrfs/systemd/UEFI, or any shell/command action; do not invent package
|
||||
atoms; keep required boot/encryption/filesystem settings fixed. You do not have
|
||||
atoms; keep required boot/encryption/filesystem/desktop (Mango + DMS) settings fixed. You do not have
|
||||
a shell and cannot execute anything.";
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||
|
|
|
|||
|
|
@ -694,12 +694,16 @@ window#waybar {
|
|||
pub const PHOEBUS_MANGO_SESSION_SCRIPT: &str = r#"#!/bin/bash
|
||||
# Phoebus Mango + DankMaterialShell session (generated by the installer).
|
||||
#
|
||||
# Hotkeys (also shown in the DMS shortcut overlay):
|
||||
# Mod+Space launcher (DMS spotlight) Mod+Return terminal
|
||||
# Mod+V clipboard history Mod+N notifications
|
||||
# Mod+Comma settings Mod+M task manager
|
||||
# Mod+a Phoebus assistant Mod+Alt+L lock
|
||||
# Mod+Shift+q close window Mod+Shift+e exit session
|
||||
# Hotkeys (dwm / dwl standard with DMS integration):
|
||||
# Mod+Shift+Return terminal Mod+Return zoom (swap master)
|
||||
# Mod+j / Mod+k focus next / prev window Mod+h / l shrink / grow master
|
||||
# Mod+Shift+j / k swap window down / up Mod+i / d inc / dec master count
|
||||
# Mod+1..9 switch workspace / tag Mod+Shift+1..9 move window to tag
|
||||
# Mod+t / m / f tile / monocle / full Mod+Shift+Space toggle float
|
||||
# Mod+Shift+c / q close window Mod+Shift+e exit session
|
||||
# Mod+Space / Mod+p launcher (spotlight) Mod+V clipboard history
|
||||
# Mod+N notifications Mod+a Phoebus assistant
|
||||
# Mod+Alt+L lock screen
|
||||
|
||||
set -u
|
||||
|
||||
|
|
@ -851,20 +855,142 @@ shadow_only_floating=1
|
|||
shadows_size=10
|
||||
shadows_blur=15
|
||||
|
||||
# Master-stack layout defaults (dwm / dwl standard)
|
||||
new_is_master=0
|
||||
default_mfact=0.55
|
||||
default_nmaster=1
|
||||
tag_num=9
|
||||
|
||||
# Tag rules: default to master-and-stack tiling layout
|
||||
tagrule=id:1,layout_name:tile
|
||||
tagrule=id:2,layout_name:tile
|
||||
tagrule=id:3,layout_name:tile
|
||||
tagrule=id:4,layout_name:tile
|
||||
tagrule=id:5,layout_name:tile
|
||||
tagrule=id:6,layout_name:tile
|
||||
tagrule=id:7,layout_name:tile
|
||||
tagrule=id:8,layout_name:tile
|
||||
tagrule=id:9,layout_name:tile
|
||||
|
||||
layerrule=noanim:1,layer_name:^dms
|
||||
windowrule=isfloating:1,appid:^com.danklinux.dms$
|
||||
|
||||
# Application launchers and DMS panels
|
||||
# ===========================================================================
|
||||
# Standard DWM / DWL Keybindings
|
||||
# ===========================================================================
|
||||
|
||||
# Terminal & Launcher
|
||||
bind=SUPER+SHIFT,Return,spawn,kitty
|
||||
bind=SUPER,Return,zoom,
|
||||
bind=SUPER,p,spawn,dms ipc call spotlight toggle
|
||||
bind=SUPER,space,spawn,dms ipc call spotlight toggle
|
||||
|
||||
# Focus navigation (dwm focusstack)
|
||||
bind=SUPER,j,focusstack,next
|
||||
bind=SUPER,k,focusstack,prev
|
||||
bind=SUPER,Down,focusdir,down
|
||||
bind=SUPER,Up,focusdir,up
|
||||
bind=SUPER,Left,focusdir,left
|
||||
bind=SUPER,Right,focusdir,right
|
||||
|
||||
# Window movement & swapping (dwm movestack / exchange)
|
||||
bind=SUPER+SHIFT,j,exchange_client,down
|
||||
bind=SUPER+SHIFT,k,exchange_client,up
|
||||
bind=SUPER+SHIFT,Down,exchange_client,down
|
||||
bind=SUPER+SHIFT,Up,exchange_client,up
|
||||
bind=SUPER+SHIFT,Left,exchange_client,left
|
||||
bind=SUPER+SHIFT,Right,exchange_client,right
|
||||
|
||||
# Master area sizing (dwm setmfact)
|
||||
bind=SUPER,h,setmfact,-0.05
|
||||
bind=SUPER,l,setmfact,+0.05
|
||||
|
||||
# Number of master windows (dwm incnmaster)
|
||||
bind=SUPER,i,incnmaster,+1
|
||||
bind=SUPER,d,incnmaster,-1
|
||||
|
||||
# Window close (dwm killclient: Mod+Shift+c and Mod+Shift+q)
|
||||
bind=SUPER+SHIFT,c,killclient,
|
||||
bind=SUPER+SHIFT,q,killclient,
|
||||
|
||||
# Layout switching
|
||||
bind=SUPER,t,setlayout,tile
|
||||
bind=SUPER,f,togglefullscreen,
|
||||
bind=SUPER,m,setlayout,monocle
|
||||
bind=SUPER+SHIFT,space,togglefloating,
|
||||
bind=SUPER+SHIFT,t,switch_layout,
|
||||
|
||||
# Tag / Workspace switching (dwm tag navigation)
|
||||
bind=SUPER,Tab,view,-1
|
||||
|
||||
bind=SUPER,1,view,1,0
|
||||
bind=SUPER,2,view,2,0
|
||||
bind=SUPER,3,view,3,0
|
||||
bind=SUPER,4,view,4,0
|
||||
bind=SUPER,5,view,5,0
|
||||
bind=SUPER,6,view,6,0
|
||||
bind=SUPER,7,view,7,0
|
||||
bind=SUPER,8,view,8,0
|
||||
bind=SUPER,9,view,9,0
|
||||
bind=SUPER,0,view,0,0
|
||||
|
||||
# Move window to tag (dwm tag)
|
||||
bind=SUPER+SHIFT,1,tag,1,0
|
||||
bind=SUPER+SHIFT,2,tag,2,0
|
||||
bind=SUPER+SHIFT,3,tag,3,0
|
||||
bind=SUPER+SHIFT,4,tag,4,0
|
||||
bind=SUPER+SHIFT,5,tag,5,0
|
||||
bind=SUPER+SHIFT,6,tag,6,0
|
||||
bind=SUPER+SHIFT,7,tag,7,0
|
||||
bind=SUPER+SHIFT,8,tag,8,0
|
||||
bind=SUPER+SHIFT,9,tag,9,0
|
||||
bind=SUPER+SHIFT,0,tag,0,0
|
||||
|
||||
# Multi-tag toggle (dwm toggleview / toggletag)
|
||||
bind=SUPER+CTRL,1,toggleview,1
|
||||
bind=SUPER+CTRL,2,toggleview,2
|
||||
bind=SUPER+CTRL,3,toggleview,3
|
||||
bind=SUPER+CTRL,4,toggleview,4
|
||||
bind=SUPER+CTRL,5,toggleview,5
|
||||
bind=SUPER+CTRL,6,toggleview,6
|
||||
bind=SUPER+CTRL,7,toggleview,7
|
||||
bind=SUPER+CTRL,8,toggleview,8
|
||||
bind=SUPER+CTRL,9,toggleview,9
|
||||
|
||||
bind=SUPER+CTRL+SHIFT,1,toggletag,1
|
||||
bind=SUPER+CTRL+SHIFT,2,toggletag,2
|
||||
bind=SUPER+CTRL+SHIFT,3,toggletag,3
|
||||
bind=SUPER+CTRL+SHIFT,4,toggletag,4
|
||||
bind=SUPER+CTRL+SHIFT,5,toggletag,5
|
||||
bind=SUPER+CTRL+SHIFT,6,toggletag,6
|
||||
bind=SUPER+CTRL+SHIFT,7,toggletag,7
|
||||
bind=SUPER+CTRL+SHIFT,8,toggletag,8
|
||||
bind=SUPER+CTRL+SHIFT,9,toggletag,9
|
||||
|
||||
# Monitor switching (dwm focusmon / tagmon)
|
||||
bind=SUPER,comma,focusmon,left
|
||||
bind=SUPER,period,focusmon,right
|
||||
bind=SUPER+SHIFT,comma,tagmon,left
|
||||
bind=SUPER+SHIFT,period,tagmon,right
|
||||
|
||||
# Mouse bindings (dwm mouse controls: move/resize/toggle float)
|
||||
mousebind=SUPER,btn_left,moveresize,curmove
|
||||
mousebind=SUPER,btn_right,moveresize,curresize
|
||||
mousebind=SUPER,btn_middle,togglefloating,
|
||||
|
||||
# ===========================================================================
|
||||
# Phoebus & DMS Desktop Integration
|
||||
# ===========================================================================
|
||||
|
||||
bind=SUPER,v,spawn,dms ipc call clipboard toggle
|
||||
bind=SUPER,m,spawn,dms ipc call processlist focusOrToggle
|
||||
bind=SUPER,comma,spawn,dms ipc call settings focusOrToggle
|
||||
bind=SUPER+CTRL,m,spawn,dms ipc call processlist focusOrToggle
|
||||
bind=SUPER+CTRL,comma,spawn,dms ipc call settings focusOrToggle
|
||||
bind=SUPER,n,spawn,dms ipc call notifications toggle
|
||||
bind=SUPER,Return,spawn,kitty
|
||||
bind=SUPER,a,spawn,phoebus-assistant
|
||||
|
||||
# Security
|
||||
# Security & Session
|
||||
bind=SUPER+ALT,l,spawn,dms ipc call lock lock
|
||||
bind=SUPER+SHIFT,e,quit,
|
||||
|
||||
# Audio
|
||||
bind=NONE,XF86AudioRaiseVolume,spawn,dms ipc call audio increment 3
|
||||
|
|
@ -874,10 +1000,6 @@ bind=NONE,XF86AudioMute,spawn,dms ipc call audio mute
|
|||
# Brightness
|
||||
bind=NONE,XF86MonBrightnessUp,spawn,dms ipc call brightness increment 5
|
||||
bind=NONE,XF86MonBrightnessDown,spawn,dms ipc call brightness decrement 5
|
||||
|
||||
# Session
|
||||
bind=SUPER+SHIFT,q,killclient,
|
||||
bind=SUPER+SHIFT,e,quit,
|
||||
"#;
|
||||
|
||||
/// The systemd user target the DMS service is bound to. Using a target means
|
||||
|
|
@ -1559,6 +1681,16 @@ mod tests {
|
|||
assert!(config.contains("XF86MonBrightnessDown"));
|
||||
assert!(config.contains("phoebus-assistant"));
|
||||
assert!(config.contains("source=~/.config/mango/dms/"));
|
||||
assert!(config.contains("focusstack,next"));
|
||||
assert!(config.contains("focusstack,prev"));
|
||||
assert!(config.contains("zoom,"));
|
||||
assert!(config.contains("setmfact,-0.05"));
|
||||
assert!(config.contains("setmfact,+0.05"));
|
||||
assert!(config.contains("killclient,"));
|
||||
assert!(config.contains("view,1,0"));
|
||||
assert!(config.contains("tag,1,0"));
|
||||
assert!(config.contains("setlayout,tile"));
|
||||
assert!(config.contains("togglefloating,"));
|
||||
|
||||
let (name, entry) = wayland_session_entry(DesktopProfile::Mango).unwrap();
|
||||
assert_eq!(name, "phoebus-mango.desktop");
|
||||
|
|
|
|||
|
|
@ -107,16 +107,7 @@ fn verify_digests(exec: &Exec, url: &str, dest: &Path) -> Result<()> {
|
|||
}
|
||||
let base = url.rsplit('/').next().unwrap_or_default();
|
||||
let text = std::fs::read_to_string(&digests).map_err(|e| ExecError::io(digests.clone(), e))?;
|
||||
let want = text.lines().find_map(|line| {
|
||||
let mut f = line.split_whitespace();
|
||||
let hash = f.next()?;
|
||||
let name = f.next()?;
|
||||
if hash.len() == 128 && name == base {
|
||||
Some(hash.to_string())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
});
|
||||
let want = parse_digests_sha512(&text, base);
|
||||
let _ = std::fs::remove_file(&digests);
|
||||
let Some(want) = want else {
|
||||
exec.logger
|
||||
|
|
@ -136,6 +127,39 @@ fn verify_digests(exec: &Exec, url: &str, dest: &Path) -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Parse the SHA-512 hash for `target_filename` from Gentoo's signed DIGESTS format.
|
||||
///
|
||||
/// Gentoo DIGESTS files list multiple hash types for the same file (e.g. BLAKE2B
|
||||
/// followed by SHA512). Because both BLAKE2B and SHA-512 are 128 hex characters,
|
||||
/// this parser explicitly tracks section headers (`# SHA512 HASH`).
|
||||
pub fn parse_digests_sha512(text: &str, target_filename: &str) -> Option<String> {
|
||||
let mut in_sha512 = false;
|
||||
for line in text.lines() {
|
||||
let trimmed = line.trim();
|
||||
if trimmed.starts_with('#') {
|
||||
in_sha512 = trimmed.to_ascii_uppercase().contains("SHA512");
|
||||
continue;
|
||||
}
|
||||
if in_sha512 {
|
||||
let mut f = trimmed.split_whitespace();
|
||||
if let (Some(hash), Some(name)) = (f.next(), f.next()) {
|
||||
if hash.len() == 128 && name == target_filename {
|
||||
return Some(hash.to_ascii_lowercase());
|
||||
}
|
||||
}
|
||||
} else if trimmed.starts_with("SHA512") && trimmed.contains(target_filename) {
|
||||
// BSD format: SHA512 (filename) = <hash>
|
||||
if let Some(hash) = trimmed.split('=').nth(1) {
|
||||
let h = hash.trim().to_ascii_lowercase();
|
||||
if h.len() == 128 {
|
||||
return Some(h);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
fn verify_signature(exec: &Exec, digests: &Path) -> Result<()> {
|
||||
let key = "/usr/share/openpgp-keys/gentoo-release.asc";
|
||||
if crate::exec::find_in_path("gpg").is_none() || !Path::new(key).is_file() {
|
||||
|
|
@ -195,3 +219,41 @@ pub fn extract(exec: &Exec, root: &Path, tarball: &Path) -> Result<()> {
|
|||
pub fn dry_output() -> CommandOutput {
|
||||
CommandOutput::dry_run()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn parse_digests_picks_sha512_over_blake2b() {
|
||||
let text = r#"
|
||||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA256
|
||||
|
||||
# BLAKE2B HASH
|
||||
e957b46a453512d76b90012592b152fd214a9066e10e33cc55f6fdece2b79ebb4c96f602fcd8af4a983aca33bd3e30bbe9510507faf9558886da1ffd5dae4e8c stage3-amd64-systemd-20260920T170055Z.tar.xz
|
||||
# SHA512 HASH
|
||||
f1a0a53dc14a544bee2827d42426448ea3247f2564a0c68d9203e97a44c329c57d4fda884a154121389253956a87c0793597c76635405aee18dbd919db579032 stage3-amd64-systemd-20260920T170055Z.tar.xz
|
||||
# BLAKE2B HASH
|
||||
9729b787ce714b744499786c1ff54a6d13bf1d6e61d5394893bbd335fe95b85b34311bbead5ce477f5b2a8d9db9d811e2f3ba64be63a7514acbd4687bcf7c5cb stage3-amd64-systemd-20260920T170055Z.tar.xz.CONTENTS.gz
|
||||
# SHA512 HASH
|
||||
e6ae2b1930064878203ab8d134fc081a252c8073730628222ee1cc4a201a56ed9c64dc7b19f1fa40e67c9ba23964d37747227fcdcb000b5e89734447216e1734 stage3-amd64-systemd-20260920T170055Z.tar.xz.CONTENTS.gz
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
"#;
|
||||
let filename = "stage3-amd64-systemd-20260920T170055Z.tar.xz";
|
||||
let hash = parse_digests_sha512(text, filename);
|
||||
assert_eq!(
|
||||
hash.as_deref(),
|
||||
Some("f1a0a53dc14a544bee2827d42426448ea3247f2564a0c68d9203e97a44c329c57d4fda884a154121389253956a87c0793597c76635405aee18dbd919db579032")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_digests_bsd_format() {
|
||||
let text = "SHA512 (stage3-test.tar.xz) = 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef";
|
||||
assert_eq!(
|
||||
parse_digests_sha512(text, "stage3-test.tar.xz").as_deref(),
|
||||
Some("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ pub fn prepare(
|
|||
let disk = &config.storage.disk;
|
||||
let root = exec.target();
|
||||
|
||||
cleanup_existing(exec, config)?;
|
||||
wipe(exec, auth, disk)?;
|
||||
create_gpt(exec, auth, config, disk)?;
|
||||
identify_partitions(exec, disk, state)?;
|
||||
|
|
@ -74,6 +75,27 @@ pub fn prepare(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Clean up any leftover mounts or opened crypt mapper from a previous failed attempt.
|
||||
pub fn cleanup_existing(exec: &Exec, config: &InstallConfig) -> Result<()> {
|
||||
let target = exec.target();
|
||||
let spec = CommandSpec::new("storage_prepare", "unmount previous target", "umount")
|
||||
.args(["-R", &target.path().to_string_lossy()]);
|
||||
let _ = exec.run(spec);
|
||||
|
||||
if config.is_encrypted() {
|
||||
let mapper = encryption::mapper_path(config);
|
||||
let name = mapper.rsplit('/').next().unwrap_or("cryptroot");
|
||||
let spec = CommandSpec::new(
|
||||
"storage_prepare",
|
||||
"close existing LUKS mapper",
|
||||
"cryptsetup",
|
||||
)
|
||||
.args(["close", name]);
|
||||
let _ = exec.run(spec);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn wipe(exec: &Exec, _auth: &DestructiveAuthorization, disk: &str) -> Result<()> {
|
||||
exec.run(
|
||||
CommandSpec::new("storage_prepare", "wipe partition signatures", "wipefs")
|
||||
|
|
|
|||
|
|
@ -308,20 +308,34 @@ impl Bridge {
|
|||
fn handshake(&self) -> Result<Value, String> {
|
||||
let facts = self.installer.system_facts();
|
||||
let network = network_ready();
|
||||
let mut defaults = self.installer.config.clone();
|
||||
let detected_tz = live_timezone();
|
||||
if defaults.system.timezone == "UTC" && detected_tz != "UTC" {
|
||||
defaults.system.timezone = detected_tz;
|
||||
}
|
||||
let detected_km = live_keymap();
|
||||
if defaults.system.keymap == "us" && detected_km != "us" {
|
||||
defaults.system.keymap = detected_km;
|
||||
}
|
||||
defaults.desktop.profile = phoebus_core::config::DesktopProfile::Mango;
|
||||
defaults.storage.filesystem = phoebus_core::config::Filesystem::Btrfs;
|
||||
defaults.desktop.flatpak = true;
|
||||
defaults.packages.nix = true;
|
||||
defaults.packages.binary_packages = true;
|
||||
Ok(json!({
|
||||
"protocol": PROTOCOL_VERSION,
|
||||
"version": phoebus_core::VERSION,
|
||||
"iso_version": iso_version(),
|
||||
"build_id": std::env::var("PHOEBUS_BUILD_ID").unwrap_or_else(|_| "dev".into()),
|
||||
"live": std::path::Path::new("/etc/phoebus/live").exists(),
|
||||
"defaults": self.installer.config,
|
||||
"defaults": defaults,
|
||||
"readiness": {
|
||||
"network": network,
|
||||
"firmware": self.installer.hardware.firmware_str(),
|
||||
"memory_mib": self.installer.hardware.memory_mib,
|
||||
"cpu_cores": self.installer.hardware.cpu.cores,
|
||||
"cpu_model": self.installer.hardware.cpu.model,
|
||||
"desktop": self.installer.config.desktop.profile.as_str(),
|
||||
"desktop": defaults.desktop.profile.as_str(),
|
||||
"keymap_live": live_keymap(),
|
||||
},
|
||||
"facts": facts,
|
||||
|
|
@ -1051,6 +1065,26 @@ fn live_keymap() -> String {
|
|||
.unwrap_or_else(|| "us".into())
|
||||
}
|
||||
|
||||
/// The live medium's timezone, read from /etc/localtime symlink or /etc/timezone.
|
||||
fn live_timezone() -> String {
|
||||
if let Ok(dest) = std::fs::read_link("/etc/localtime") {
|
||||
let path = dest.display().to_string();
|
||||
if let Some(pos) = path.find("zoneinfo/") {
|
||||
let tz = &path[pos + "zoneinfo/".len()..];
|
||||
if !tz.is_empty() {
|
||||
return tz.to_string();
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Ok(text) = std::fs::read_to_string("/etc/timezone") {
|
||||
let trimmed = text.trim();
|
||||
if !trimmed.is_empty() {
|
||||
return trimmed.to_string();
|
||||
}
|
||||
}
|
||||
"UTC".to_string()
|
||||
}
|
||||
|
||||
/// Classify a connection error into a stable kind. The frontend uses this to
|
||||
/// show an actionable recovery instead of a raw transport string.
|
||||
fn connection_error_kind(message: &str) -> &'static str {
|
||||
|
|
@ -1252,6 +1286,9 @@ fn humanize_keymap(name: &str) -> String {
|
|||
let language = match base {
|
||||
"us" => "English (US)",
|
||||
"gb" | "uk" => "English (UK)",
|
||||
"au" => "English (Australia)",
|
||||
"nz" => "English (New Zealand)",
|
||||
"za" => "English (South Africa)",
|
||||
"de" => "German",
|
||||
"fr" => "French",
|
||||
"es" => "Spanish",
|
||||
|
|
@ -1279,7 +1316,7 @@ fn humanize_keymap(name: &str) -> String {
|
|||
"il" => "Hebrew",
|
||||
"ara" => "Arabic",
|
||||
"in" => "Indian",
|
||||
"jp106" => "Japanese",
|
||||
"jp" | "jp106" => "Japanese",
|
||||
"kr" => "Korean",
|
||||
"cn" => "Chinese",
|
||||
"tw" => "Chinese (Taiwan)",
|
||||
|
|
@ -1297,13 +1334,30 @@ fn humanize_keymap(name: &str) -> String {
|
|||
"rs" => "Serbian",
|
||||
"by" => "Belarusian",
|
||||
"kz" => "Kazakh",
|
||||
"al" => "Albanian",
|
||||
"ba" => "Bosnian",
|
||||
"ph" => "Filipino",
|
||||
"id" => "Indonesian",
|
||||
"my" => "Malay",
|
||||
"mt" => "Maltese",
|
||||
"np" => "Nepali",
|
||||
"pk" => "Urdu",
|
||||
"uz" => "Uzbek",
|
||||
"et" => "Amharic",
|
||||
"bd" => "Bangla",
|
||||
"af" => "Dari",
|
||||
"dz" => "Berber",
|
||||
"kh" => "Khmer",
|
||||
"la" => "Lao",
|
||||
"me" => "Montenegrin",
|
||||
"mn" => "Mongolian",
|
||||
"us-dvorak" | "dvorak" => "Dvorak",
|
||||
"colemak" => "Colemak",
|
||||
"mac-us" => "Mac (US)",
|
||||
"sg" => "Swiss German",
|
||||
"th" => "Thai",
|
||||
"vn" => "Vietnamese",
|
||||
"fa" => "Persian",
|
||||
"ir" | "fa" => "Persian",
|
||||
"az" => "Azerbaijani",
|
||||
"ge" => "Georgian",
|
||||
"am" => "Armenian",
|
||||
|
|
@ -1411,8 +1465,9 @@ fn system_locales() -> Vec<String> {
|
|||
continue;
|
||||
}
|
||||
if let Some(locale) = line.split_whitespace().next() {
|
||||
// Prefer UTF-8 variants; keep the rest too.
|
||||
locales.insert(locale.to_string());
|
||||
if locale.contains("UTF-8") {
|
||||
locales.insert(locale.to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1425,138 +1480,79 @@ fn system_locales() -> Vec<String> {
|
|||
"es_ES.UTF-8",
|
||||
"it_IT.UTF-8",
|
||||
"pt_BR.UTF-8",
|
||||
"pt_PT.UTF-8",
|
||||
"ja_JP.UTF-8",
|
||||
"zh_CN.UTF-8",
|
||||
"zh_TW.UTF-8",
|
||||
"ko_KR.UTF-8",
|
||||
"ru_RU.UTF-8",
|
||||
"nl_NL.UTF-8",
|
||||
"pl_PL.UTF-8",
|
||||
"sv_SE.UTF-8",
|
||||
"da_DK.UTF-8",
|
||||
"nb_NO.UTF-8",
|
||||
"fi_FI.UTF-8",
|
||||
"cs_CZ.UTF-8",
|
||||
"uk_UA.UTF-8",
|
||||
"tr_TR.UTF-8",
|
||||
] {
|
||||
locales.insert(locale.to_string());
|
||||
}
|
||||
}
|
||||
locales.into_iter().take(2000).collect()
|
||||
let mut list: Vec<String> = locales.into_iter().take(2000).collect();
|
||||
if let Some(pos) = list.iter().position(|x| x == "en_US.UTF-8") {
|
||||
let us = list.remove(pos);
|
||||
list.insert(0, us);
|
||||
}
|
||||
list
|
||||
}
|
||||
|
||||
/// Console keymaps from the system's keymap trees.
|
||||
/// Keyboard layouts from XKB rules (or a standard desktop fallback set).
|
||||
fn system_keymaps() -> Vec<String> {
|
||||
let mut keymaps: std::collections::BTreeSet<String> = std::collections::BTreeSet::new();
|
||||
for root in ["/usr/share/keymaps", "/usr/share/kbd/keymaps"] {
|
||||
collect_keymaps(std::path::Path::new(root), &mut keymaps, 0);
|
||||
}
|
||||
if keymaps.is_empty() {
|
||||
// The live medium does not always ship the kbd keymap tree, so fall
|
||||
// back to the common console keymaps. The combo still accepts a
|
||||
// custom value.
|
||||
for name in [
|
||||
"us",
|
||||
"us-acentos",
|
||||
"uk",
|
||||
"gb",
|
||||
"de",
|
||||
"de-latin1",
|
||||
"de-latin1-nodeadkeys",
|
||||
"de-nodeadkeys",
|
||||
"fr",
|
||||
"fr-latin9",
|
||||
"fr-latin1",
|
||||
"fr-pc",
|
||||
"es",
|
||||
"es-cp850",
|
||||
"it",
|
||||
"it2",
|
||||
"pt",
|
||||
"pt-latin1",
|
||||
"nl",
|
||||
"nl2",
|
||||
"be",
|
||||
"dk",
|
||||
"dk-latin1",
|
||||
"no",
|
||||
"no-latin1",
|
||||
"se",
|
||||
"fi",
|
||||
"is",
|
||||
"ie",
|
||||
"ie-Gaelic",
|
||||
"pl",
|
||||
"pl2",
|
||||
"cz",
|
||||
"cz-us-qwertz",
|
||||
"sk",
|
||||
"hu",
|
||||
"hu101",
|
||||
"ro",
|
||||
"bg",
|
||||
"gr",
|
||||
"gr-pc",
|
||||
"ru",
|
||||
"ruwin_alt-UTF-8",
|
||||
"ua-utf",
|
||||
"tr",
|
||||
"trq",
|
||||
"il",
|
||||
"ara",
|
||||
"in",
|
||||
"jp106",
|
||||
"kr",
|
||||
"kr-utf",
|
||||
"cn",
|
||||
"tw",
|
||||
"br-abnt2",
|
||||
"latam",
|
||||
"ca",
|
||||
"cf",
|
||||
"ch",
|
||||
"ch-fr",
|
||||
"at",
|
||||
"si",
|
||||
"hr",
|
||||
"ee",
|
||||
"lt",
|
||||
"lv",
|
||||
"mk",
|
||||
"rs",
|
||||
"by",
|
||||
"kz",
|
||||
"us-dvorak",
|
||||
"dvorak",
|
||||
"colemak",
|
||||
"mac-us",
|
||||
"sun-pl",
|
||||
"sg",
|
||||
"th",
|
||||
"vn",
|
||||
"fa",
|
||||
"az",
|
||||
"ge",
|
||||
"am",
|
||||
] {
|
||||
keymaps.insert(name.to_string());
|
||||
}
|
||||
}
|
||||
keymaps.into_iter().take(2000).collect()
|
||||
}
|
||||
|
||||
fn collect_keymaps(
|
||||
dir: &std::path::Path,
|
||||
out: &mut std::collections::BTreeSet<String>,
|
||||
depth: usize,
|
||||
) {
|
||||
if depth > 6 {
|
||||
return;
|
||||
}
|
||||
let Ok(entries) = std::fs::read_dir(dir) else {
|
||||
return;
|
||||
};
|
||||
for entry in entries.flatten() {
|
||||
let path = entry.path();
|
||||
if path.is_dir() {
|
||||
collect_keymaps(&path, out, depth + 1);
|
||||
} else if let Some(name) = path.file_name().and_then(|n| n.to_str()) {
|
||||
for suffix in [".map.gz", ".map"] {
|
||||
if let Some(stem) = name.strip_suffix(suffix) {
|
||||
out.insert(stem.to_string());
|
||||
for path in [
|
||||
"/usr/share/X11/xkb/rules/evdev.lst",
|
||||
"/usr/share/X11/xkb/rules/base.lst",
|
||||
] {
|
||||
if let Ok(content) = std::fs::read_to_string(path) {
|
||||
let mut in_layout = false;
|
||||
let mut list = Vec::new();
|
||||
for line in content.lines() {
|
||||
let trimmed = line.trim();
|
||||
if trimmed.starts_with('!') {
|
||||
if trimmed == "! layout" {
|
||||
in_layout = true;
|
||||
} else if in_layout {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if in_layout && !trimmed.is_empty() {
|
||||
if let Some(code) = trimmed.split_whitespace().next() {
|
||||
if code != "custom" {
|
||||
list.push(code.to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if !list.is_empty() {
|
||||
if let Some(pos) = list.iter().position(|x| x == "us") {
|
||||
let us = list.remove(pos);
|
||||
list.insert(0, us);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fallback list of standard desktop keyboard layouts
|
||||
vec![
|
||||
"us", "gb", "de", "fr", "es", "latam", "it", "pt", "br", "nl", "be", "ch", "at", "dk",
|
||||
"no", "se", "fi", "pl", "cz", "sk", "hu", "ro", "bg", "gr", "ru", "ua", "tr", "il", "ara",
|
||||
"in", "jp", "kr", "cn", "tw", "ca", "ie", "si", "hr", "ee", "lt", "lv", "rs", "by", "kz",
|
||||
"th", "vn", "ir", "az", "ge", "am", "al", "ba", "dvorak", "colemak",
|
||||
]
|
||||
.into_iter()
|
||||
.map(String::from)
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// The OpenAI-compatible model-list URL for a chat-completions endpoint.
|
||||
|
|
|
|||
|
|
@ -1,28 +1,35 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
// A labelled input with an inline, filtered suggestion list. The user can type
|
||||
// to narrow the list, click an entry, or use the arrow keys: Up/Down move a
|
||||
// visible highlight, Enter selects it, Escape closes the list. A custom value
|
||||
// is still allowed. Used for timezone, locale, keymap, provider and model so
|
||||
// the user picks from what the system actually offers instead of typing from
|
||||
// memory. `options` may be strings or `{value,label}` pairs; the value is the
|
||||
// identifier the backend validates, the label is what the user reads.
|
||||
// A styled dropdown selection menu with built-in search and scrolling.
|
||||
//
|
||||
// Shows a dropdown toggle button with the current selection. Clicking it opens
|
||||
// a scrollable menu of all available options (with instant search filtering).
|
||||
// `options` may be plain strings or `{value, label}` pairs.
|
||||
Column {
|
||||
id: combo
|
||||
|
||||
property string label: ""
|
||||
property string placeholder: ""
|
||||
property string placeholder: "Select an option..."
|
||||
property string error: ""
|
||||
property var options: []
|
||||
property int maxVisible: 8
|
||||
property string hint: "Type to filter · ↑ ↓ to choose · Enter to select"
|
||||
property alias text: field.text
|
||||
property alias inputItem: field.inputItem
|
||||
property var suggestions: []
|
||||
property bool popupOpen: false
|
||||
property string currentValue: ""
|
||||
property string currentLabel: ""
|
||||
property int highlightIndex: -1
|
||||
property bool dismissed: false
|
||||
readonly property bool open: field.inputItem.activeFocus && !combo.dismissed
|
||||
&& combo.suggestions.length > 0
|
||||
|
||||
property var filteredOptions: []
|
||||
|
||||
// Compatibility aliases for existing bridge and harness code
|
||||
property alias text: combo.currentValue
|
||||
property var inputItem: QtObject {
|
||||
property alias text: combo.currentValue
|
||||
property bool activeFocus: combo.popupOpen || searchField.activeFocus
|
||||
function forceActiveFocus() {
|
||||
combo.popupOpen = true;
|
||||
searchField.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
signal edited(string value)
|
||||
signal selected(string value)
|
||||
|
|
@ -33,153 +40,278 @@ Column {
|
|||
function optionValue(option) {
|
||||
return (option !== null && typeof option === "object") ? ("" + option.value) : ("" + option);
|
||||
}
|
||||
|
||||
function optionLabel(option) {
|
||||
return (option !== null && typeof option === "object" && option.label !== undefined)
|
||||
? ("" + option.label) : ("" + option);
|
||||
}
|
||||
|
||||
function refresh() {
|
||||
const query = (field.text || "").toLowerCase();
|
||||
function updateCurrentLabel() {
|
||||
const all = combo.options || [];
|
||||
for (let i = 0; i < all.length; i++) {
|
||||
if (combo.optionValue(all[i]) === combo.currentValue) {
|
||||
combo.currentLabel = combo.optionLabel(all[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
combo.currentLabel = combo.currentValue;
|
||||
}
|
||||
|
||||
function refreshFilter() {
|
||||
const query = (searchField.text || "").trim().toLowerCase();
|
||||
const all = combo.options || [];
|
||||
const out = [];
|
||||
for (let i = 0; i < all.length && out.length < combo.maxVisible; i++) {
|
||||
const value = combo.optionValue(all[i]);
|
||||
const label = combo.optionLabel(all[i]);
|
||||
for (let i = 0; i < all.length; i++) {
|
||||
const val = combo.optionValue(all[i]);
|
||||
const lbl = combo.optionLabel(all[i]);
|
||||
if (query.length === 0
|
||||
|| value.toLowerCase().indexOf(query) !== -1
|
||||
|| label.toLowerCase().indexOf(query) !== -1)
|
||||
out.push({ value: value, label: label });
|
||||
|| val.toLowerCase().indexOf(query) !== -1
|
||||
|| lbl.toLowerCase().indexOf(query) !== -1) {
|
||||
out.push({ value: val, label: lbl });
|
||||
}
|
||||
}
|
||||
combo.suggestions = out;
|
||||
combo.filteredOptions = out;
|
||||
if (combo.highlightIndex >= out.length)
|
||||
combo.highlightIndex = out.length - 1;
|
||||
combo.highlightIndex = out.length > 0 ? 0 : -1;
|
||||
}
|
||||
|
||||
function choose(index) {
|
||||
if (index < 0 || index >= combo.suggestions.length)
|
||||
return;
|
||||
const chosen = combo.suggestions[index];
|
||||
field.inputItem.text = chosen.value;
|
||||
combo.suggestions = [];
|
||||
combo.highlightIndex = -1;
|
||||
combo.dismissed = false;
|
||||
combo.selected(chosen.value);
|
||||
}
|
||||
|
||||
function commit() {
|
||||
if (combo.open && combo.highlightIndex >= 0)
|
||||
combo.choose(combo.highlightIndex);
|
||||
else {
|
||||
combo.suggestions = [];
|
||||
combo.dismissed = true;
|
||||
}
|
||||
function choose(val, lbl) {
|
||||
combo.currentValue = val;
|
||||
combo.currentLabel = lbl;
|
||||
combo.popupOpen = false;
|
||||
searchField.text = "";
|
||||
combo.edited(val);
|
||||
combo.selected(val);
|
||||
}
|
||||
|
||||
function forceFocus() {
|
||||
field.inputItem.forceActiveFocus();
|
||||
combo.popupOpen = true;
|
||||
searchField.forceActiveFocus();
|
||||
}
|
||||
|
||||
onOptionsChanged: combo.refresh()
|
||||
Component.onCompleted: combo.refresh()
|
||||
|
||||
PhoebusField {
|
||||
id: field
|
||||
width: parent.width
|
||||
label: combo.label
|
||||
placeholder: combo.placeholder
|
||||
error: combo.error
|
||||
escapeConsumed: combo.open
|
||||
returnConsumed: combo.open
|
||||
onEdited: value => {
|
||||
combo.dismissed = false;
|
||||
combo.refresh();
|
||||
combo.edited(value);
|
||||
}
|
||||
onKeyUp: {
|
||||
if (combo.suggestions.length === 0)
|
||||
return;
|
||||
combo.dismissed = false;
|
||||
combo.highlightIndex = combo.highlightIndex < 0
|
||||
? combo.suggestions.length - 1
|
||||
: (combo.highlightIndex <= 0
|
||||
? combo.suggestions.length - 1 : combo.highlightIndex - 1);
|
||||
}
|
||||
onKeyDown: {
|
||||
if (combo.suggestions.length === 0)
|
||||
return;
|
||||
combo.dismissed = false;
|
||||
combo.highlightIndex = combo.highlightIndex < 0
|
||||
? 0
|
||||
: (combo.highlightIndex >= combo.suggestions.length - 1
|
||||
? 0 : combo.highlightIndex + 1);
|
||||
}
|
||||
onKeyEscape: combo.dismissed = true
|
||||
onAccepted: combo.commit()
|
||||
}
|
||||
|
||||
// Show suggestions as soon as the field takes focus, and clear the
|
||||
// highlight when it loses focus.
|
||||
Connections {
|
||||
target: field.inputItem
|
||||
function onActiveFocusChanged() {
|
||||
if (field.inputItem.activeFocus) {
|
||||
combo.dismissed = false;
|
||||
combo.refresh();
|
||||
} else {
|
||||
combo.dismissed = false;
|
||||
combo.highlightIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 0
|
||||
visible: combo.open
|
||||
Repeater {
|
||||
model: combo.open ? combo.suggestions : []
|
||||
delegate: Rectangle {
|
||||
id: row
|
||||
required property var modelData
|
||||
required property int index
|
||||
width: parent.width
|
||||
height: 30
|
||||
color: index === combo.highlightIndex ? Theme.amberDeep
|
||||
: (hover.containsMouse ? Theme.surfaceRaised : Theme.surface)
|
||||
border.width: 1
|
||||
border.color: index === combo.highlightIndex ? Theme.amber : Theme.border
|
||||
Accessible.role: Accessible.ListItem
|
||||
Accessible.name: row.modelData.label
|
||||
Accessible.selected: index === combo.highlightIndex
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: 12
|
||||
anchors.rightMargin: 12
|
||||
text: row.modelData.label
|
||||
elide: Text.ElideRight
|
||||
color: index === combo.highlightIndex ? Theme.charcoal : Theme.warmWhite
|
||||
font.family: Theme.family
|
||||
font.pixelSize: Theme.fontSmall
|
||||
}
|
||||
MouseArea {
|
||||
id: hover
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: combo.choose(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
onCurrentValueChanged: updateCurrentLabel()
|
||||
onOptionsChanged: {
|
||||
updateCurrentLabel();
|
||||
refreshFilter();
|
||||
}
|
||||
Component.onCompleted: {
|
||||
updateCurrentLabel();
|
||||
refreshFilter();
|
||||
}
|
||||
|
||||
// Label
|
||||
Text {
|
||||
width: parent.width
|
||||
visible: field.inputItem.activeFocus && combo.options.length > 0
|
||||
text: combo.hint
|
||||
color: Theme.muted
|
||||
text: combo.label
|
||||
color: Theme.warmWhite
|
||||
font.family: Theme.family
|
||||
font.pixelSize: Theme.fontSmall
|
||||
font.weight: Font.DemiBold
|
||||
visible: combo.label.length > 0
|
||||
}
|
||||
|
||||
// Main Selection Box (Clickable)
|
||||
Rectangle {
|
||||
id: selectorBox
|
||||
width: parent.width
|
||||
height: Theme.controlHeight
|
||||
radius: Theme.radiusSmall
|
||||
color: Theme.charcoal
|
||||
border.width: combo.popupOpen ? 2 : 1
|
||||
border.color: combo.error.length > 0 ? Theme.danger
|
||||
: combo.popupOpen ? Theme.focusRing
|
||||
: Theme.border
|
||||
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.right: chevron.left
|
||||
anchors.leftMargin: 12
|
||||
anchors.rightMargin: 8
|
||||
text: combo.currentLabel.length > 0 ? combo.currentLabel : combo.placeholder
|
||||
color: combo.currentLabel.length > 0 ? Theme.warmWhite : Theme.muted
|
||||
font.family: Theme.family
|
||||
font.pixelSize: Theme.fontBody
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
Text {
|
||||
id: chevron
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 14
|
||||
text: combo.popupOpen ? "\u25B4" : "\u25BE"
|
||||
color: Theme.muted
|
||||
font.pixelSize: Theme.fontHeading
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
combo.popupOpen = !combo.popupOpen;
|
||||
if (combo.popupOpen) {
|
||||
searchField.text = "";
|
||||
combo.refreshFilter();
|
||||
searchField.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Inline Error
|
||||
Text {
|
||||
width: parent.width
|
||||
visible: combo.error.length > 0
|
||||
text: combo.error
|
||||
color: Theme.danger
|
||||
font.family: Theme.family
|
||||
font.pixelSize: Theme.fontSmall
|
||||
}
|
||||
|
||||
// Dropdown Menu Panel
|
||||
Rectangle {
|
||||
id: dropdownMenu
|
||||
width: parent.width
|
||||
visible: combo.popupOpen
|
||||
height: visible ? (searchBoxRect.height + listContainer.height + 16) : 0
|
||||
radius: Theme.radiusSmall
|
||||
color: Theme.surfaceRaised
|
||||
border.width: 1
|
||||
border.color: Theme.border
|
||||
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 8
|
||||
spacing: 6
|
||||
|
||||
// Search filter box inside dropdown
|
||||
Rectangle {
|
||||
id: searchBoxRect
|
||||
width: parent.width
|
||||
height: 34
|
||||
radius: 4
|
||||
color: Theme.surface
|
||||
border.width: 1
|
||||
border.color: searchField.activeFocus ? Theme.focusRing : Theme.border
|
||||
|
||||
TextInput {
|
||||
id: searchField
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 8
|
||||
anchors.rightMargin: 8
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
color: Theme.warmWhite
|
||||
font.family: Theme.family
|
||||
font.pixelSize: Theme.fontSmall
|
||||
selectionColor: Theme.amberDeep
|
||||
selectedTextColor: Theme.warmWhite
|
||||
clip: true
|
||||
|
||||
Text {
|
||||
anchors.fill: parent
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: "Type to filter options..."
|
||||
color: Theme.muted
|
||||
font.family: Theme.family
|
||||
font.pixelSize: Theme.fontSmall
|
||||
visible: searchField.text.length === 0
|
||||
}
|
||||
|
||||
onTextChanged: combo.refreshFilter()
|
||||
|
||||
Keys.onUpPressed: event => {
|
||||
event.accepted = true;
|
||||
if (combo.filteredOptions.length === 0) return;
|
||||
combo.highlightIndex = combo.highlightIndex <= 0 ? combo.filteredOptions.length - 1 : combo.highlightIndex - 1;
|
||||
listView.positionViewAtIndex(combo.highlightIndex, ListView.Contain);
|
||||
}
|
||||
Keys.onDownPressed: event => {
|
||||
event.accepted = true;
|
||||
if (combo.filteredOptions.length === 0) return;
|
||||
combo.highlightIndex = combo.highlightIndex >= combo.filteredOptions.length - 1 ? 0 : combo.highlightIndex + 1;
|
||||
listView.positionViewAtIndex(combo.highlightIndex, ListView.Contain);
|
||||
}
|
||||
Keys.onReturnPressed: event => {
|
||||
event.accepted = true;
|
||||
if (combo.highlightIndex >= 0 && combo.highlightIndex < combo.filteredOptions.length) {
|
||||
const chosen = combo.filteredOptions[combo.highlightIndex];
|
||||
combo.choose(chosen.value, chosen.label);
|
||||
}
|
||||
}
|
||||
Keys.onEnterPressed: event => {
|
||||
event.accepted = true;
|
||||
if (combo.highlightIndex >= 0 && combo.highlightIndex < combo.filteredOptions.length) {
|
||||
const chosen = combo.filteredOptions[combo.highlightIndex];
|
||||
combo.choose(chosen.value, chosen.label);
|
||||
}
|
||||
}
|
||||
Keys.onEscapePressed: event => {
|
||||
event.accepted = true;
|
||||
combo.popupOpen = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Scrollable list of options
|
||||
Item {
|
||||
id: listContainer
|
||||
width: parent.width
|
||||
height: Math.min(220, listView.contentHeight > 0 ? listView.contentHeight : 40)
|
||||
clip: true
|
||||
|
||||
ListView {
|
||||
id: listView
|
||||
anchors.fill: parent
|
||||
model: combo.filteredOptions
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
active: true
|
||||
policy: listView.contentHeight > listView.height ? ScrollBar.AlwaysOn : ScrollBar.AsNeeded
|
||||
}
|
||||
|
||||
delegate: Rectangle {
|
||||
id: optionRow
|
||||
required property var modelData
|
||||
required property int index
|
||||
width: listView.width
|
||||
height: 32
|
||||
radius: 4
|
||||
color: index === combo.highlightIndex ? Theme.amberDeep
|
||||
: (rowHover.containsMouse ? Theme.surface : "transparent")
|
||||
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: 10
|
||||
anchors.rightMargin: 10
|
||||
text: optionRow.modelData.label
|
||||
color: index === combo.highlightIndex ? Theme.charcoal : Theme.warmWhite
|
||||
font.family: Theme.family
|
||||
font.pixelSize: Theme.fontSmall
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: rowHover
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: combo.choose(optionRow.modelData.value, optionRow.modelData.label)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: "No matching options found"
|
||||
color: Theme.muted
|
||||
font.family: Theme.family
|
||||
font.pixelSize: Theme.fontSmall
|
||||
visible: combo.filteredOptions.length === 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import "Common"
|
||||
|
|
@ -46,6 +47,8 @@ ShellRoot {
|
|||
property string userPw2: ""
|
||||
property string luksPw: ""
|
||||
property string luksPw2: ""
|
||||
property bool useSamePasswordForDisk: true
|
||||
property bool showProgressDetails: false
|
||||
property string apiKey: ""
|
||||
// OpenCode server password (basic auth), distinct from a provider API key.
|
||||
property string opencodePassword: ""
|
||||
|
|
@ -171,7 +174,6 @@ ShellRoot {
|
|||
localeField.inputItem.text = shell.cfg.system.locale;
|
||||
keymapField.inputItem.text = shell.cfg.system.keymap;
|
||||
tzField.inputItem.text = shell.cfg.system.timezone;
|
||||
fullnameField.inputItem.text = shell.cfg.user.fullname;
|
||||
userField.inputItem.text = shell.cfg.user.username;
|
||||
hostField.inputItem.text = shell.cfg.system.hostname;
|
||||
modelField.inputItem.text = shell.cfg.ai.model;
|
||||
|
|
@ -183,8 +185,10 @@ ShellRoot {
|
|||
opencodePasswordField.inputItem.text = shell.opencodePassword;
|
||||
pwField.inputItem.text = shell.userPw;
|
||||
pw2Field.inputItem.text = shell.userPw2;
|
||||
luksField.inputItem.text = shell.luksPw;
|
||||
luks2Field.inputItem.text = shell.luksPw2;
|
||||
if (!shell.useSamePasswordForDisk) {
|
||||
if (luksField) luksField.inputItem.text = shell.luksPw;
|
||||
if (luks2Field) luks2Field.inputItem.text = shell.luksPw2;
|
||||
}
|
||||
}
|
||||
|
||||
function setIssue(field, message) {
|
||||
|
|
@ -218,8 +222,7 @@ ShellRoot {
|
|||
password: pwField,
|
||||
password_confirm: pw2Field,
|
||||
passphrase: luksField,
|
||||
passphrase_confirm: luks2Field,
|
||||
erase: eraseField
|
||||
passphrase_confirm: luks2Field
|
||||
};
|
||||
return map[field] !== undefined ? map[field] : null;
|
||||
}
|
||||
|
|
@ -239,7 +242,7 @@ ShellRoot {
|
|||
function focusCurrentStep() {
|
||||
const targets = [
|
||||
welcomeNext, localeField, networkRetry, null,
|
||||
diskFocusAnchor, fullnameField, eraseField
|
||||
diskFocusAnchor, userField, null
|
||||
];
|
||||
if (shell.step === 3) {
|
||||
providerChoice.focusFirst();
|
||||
|
|
@ -728,8 +731,8 @@ ShellRoot {
|
|||
clearIssues();
|
||||
let ok = true;
|
||||
let first = "";
|
||||
if (shell.userPw.length < 8) {
|
||||
setIssue("password", "Use at least 8 characters.");
|
||||
if (shell.userPw.length === 0) {
|
||||
setIssue("password", "Enter a password.");
|
||||
if (!first) first = "password";
|
||||
ok = false;
|
||||
}
|
||||
|
|
@ -738,15 +741,20 @@ ShellRoot {
|
|||
if (!first) first = "password_confirm";
|
||||
ok = false;
|
||||
}
|
||||
if (shell.luksPw.length < 8) {
|
||||
setIssue("passphrase", "Use at least 8 characters.");
|
||||
if (!first) first = "passphrase";
|
||||
ok = false;
|
||||
}
|
||||
if (shell.luksPw !== shell.luksPw2) {
|
||||
setIssue("passphrase_confirm", "The passphrases do not match.");
|
||||
if (!first) first = "passphrase_confirm";
|
||||
ok = false;
|
||||
if (shell.useSamePasswordForDisk) {
|
||||
shell.luksPw = shell.userPw;
|
||||
shell.luksPw2 = shell.userPw2;
|
||||
} else {
|
||||
if (shell.luksPw.length === 0) {
|
||||
setIssue("passphrase", "Enter an encryption passphrase.");
|
||||
if (!first) first = "passphrase";
|
||||
ok = false;
|
||||
}
|
||||
if (shell.luksPw !== shell.luksPw2) {
|
||||
setIssue("passphrase_confirm", "The passphrases do not match.");
|
||||
if (!first) first = "passphrase_confirm";
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
if (!ok && first)
|
||||
shell.focusIssueField(first);
|
||||
|
|
@ -758,6 +766,13 @@ ShellRoot {
|
|||
shell.status = "Please fix the highlighted fields.";
|
||||
return;
|
||||
}
|
||||
if (shell.cfg) {
|
||||
shell.cfg.desktop.profile = "mango";
|
||||
shell.cfg.storage.filesystem = "btrfs";
|
||||
shell.cfg.desktop.flatpak = true;
|
||||
shell.cfg.packages.nix = true;
|
||||
shell.cfg.packages.binary_packages = true;
|
||||
}
|
||||
// The backend validates username/hostname; secrets go over stdin only.
|
||||
const secrets = {
|
||||
luks: shell.luksPw,
|
||||
|
|
@ -773,15 +788,6 @@ ShellRoot {
|
|||
}
|
||||
|
||||
function authorizeAndInstall() {
|
||||
if (shell.eraseText !== "ERASE") {
|
||||
shell.status = "Type ERASE exactly (case sensitive) to continue.";
|
||||
shell.focusIssueField("erase");
|
||||
return;
|
||||
}
|
||||
if (!shell.finalConfirm) {
|
||||
shell.status = "Tick the confirmation to continue.";
|
||||
return;
|
||||
}
|
||||
if (!Bridge.ready) {
|
||||
shell.status = "The installer backend is not running. Restart it and try again.";
|
||||
return;
|
||||
|
|
@ -789,7 +795,7 @@ ShellRoot {
|
|||
if (shell.installStarting)
|
||||
return;
|
||||
shell.installStarting = true;
|
||||
shell.status = "Authorizing…";
|
||||
shell.status = "Starting installation…";
|
||||
Bridge.destructivePreview(reply => {
|
||||
if (!reply.ok) {
|
||||
shell.installStarting = false;
|
||||
|
|
@ -996,10 +1002,10 @@ ShellRoot {
|
|||
|
||||
Timer {
|
||||
id: progressLogTimer
|
||||
interval: 5000
|
||||
interval: 1500
|
||||
repeat: true
|
||||
running: shell.phase === "progress"
|
||||
onTriggered: Bridge.logTail(40, r => {
|
||||
onTriggered: Bridge.logTail(shell.showProgressDetails ? 150 : 30, r => {
|
||||
if (!r.ok)
|
||||
return;
|
||||
shell.logLines = r.data.lines;
|
||||
|
|
@ -1201,19 +1207,6 @@ ShellRoot {
|
|||
onSelected: value => { shell.cfg.system.timezone = value; shell.logState("field"); }
|
||||
}
|
||||
}
|
||||
PhoebusCard {
|
||||
width: parent.width
|
||||
Text { width: parent.width; text: "Test the live keyboard"; color: Theme.warmWhite; font.family: Theme.family; font.pixelSize: Theme.fontHeading; font.weight: Font.DemiBold }
|
||||
Text {
|
||||
width: parent.width
|
||||
text: "Type a sentence to check the keyboard you are using right now (the live session uses \"" + shell.liveKeymap + "\"). The layout you chose above is applied to the installed system; the running live session keeps its own layout until you restart."
|
||||
color: Theme.muted
|
||||
font.family: Theme.family
|
||||
font.pixelSize: Theme.fontSmall
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
PhoebusField { id: kbTest; label: "Type here"; placeholder: "The quick brown fox…" }
|
||||
}
|
||||
}
|
||||
|
||||
// ============ STEP 2: network =========================
|
||||
|
|
@ -1547,55 +1540,94 @@ ShellRoot {
|
|||
PhoebusCard {
|
||||
width: parent.width
|
||||
Text { width: parent.width; text: "Your account"; color: Theme.warmWhite; font.family: Theme.family; font.pixelSize: Theme.fontHeading; font.weight: Font.DemiBold }
|
||||
Text { width: parent.width; text: "This is the everyday login you will use to sign in to Phoebus. It is asked for at the login screen after the disk is unlocked."; color: Theme.muted; font.family: Theme.family; font.pixelSize: Theme.fontSmall; wrapMode: Text.WordWrap }
|
||||
PhoebusField { id: fullnameField; label: "Full name"; onEdited: value => shell.cfg.user.fullname = value }
|
||||
PhoebusField { id: userField; label: "Username"; placeholder: "lowercase"; error: shell.issueFor("username"); onEdited: value => shell.cfg.user.username = value }
|
||||
PhoebusField { id: hostField; label: "Computer name"; placeholder: "phoebus"; error: shell.issueFor("hostname"); onEdited: value => shell.cfg.system.hostname = value }
|
||||
PhoebusField { id: pwField; label: "Login password"; secret: true; placeholder: "At least 8 characters"; error: shell.issueFor("password"); onEdited: value => shell.userPw = value }
|
||||
PhoebusField { id: pw2Field; label: "Confirm login password"; secret: true; placeholder: "Repeat the password"; error: shell.issueFor("password_confirm"); onEdited: value => shell.userPw2 = value }
|
||||
Text { width: parent.width; text: "This is your login account for Phoebus."; color: Theme.muted; font.family: Theme.family; font.pixelSize: Theme.fontSmall; wrapMode: Text.WordWrap }
|
||||
PhoebusField {
|
||||
id: userField
|
||||
label: "Username"
|
||||
placeholder: "e.g. dominic"
|
||||
error: shell.issueFor("username")
|
||||
onEdited: value => {
|
||||
shell.cfg.user.username = value;
|
||||
shell.cfg.user.fullname = value;
|
||||
}
|
||||
}
|
||||
PhoebusField {
|
||||
id: hostField
|
||||
label: "Computer name"
|
||||
placeholder: "phoebus"
|
||||
error: shell.issueFor("hostname")
|
||||
onEdited: value => shell.cfg.system.hostname = value
|
||||
}
|
||||
PhoebusField {
|
||||
id: pwField
|
||||
label: "Password"
|
||||
secret: true
|
||||
placeholder: "Enter password"
|
||||
error: shell.issueFor("password")
|
||||
onEdited: value => {
|
||||
shell.userPw = value;
|
||||
if (shell.useSamePasswordForDisk) {
|
||||
shell.luksPw = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
PhoebusField {
|
||||
id: pw2Field
|
||||
label: "Confirm password"
|
||||
secret: true
|
||||
placeholder: "Repeat password"
|
||||
error: shell.issueFor("password_confirm")
|
||||
onEdited: value => {
|
||||
shell.userPw2 = value;
|
||||
if (shell.useSamePasswordForDisk) {
|
||||
shell.luksPw2 = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
PhoebusCard {
|
||||
width: parent.width
|
||||
Text { width: parent.width; text: "Disk encryption"; color: Theme.warmWhite; font.family: Theme.family; font.pixelSize: Theme.fontHeading; font.weight: Font.DemiBold }
|
||||
Text { width: parent.width; text: "The encryption passphrase is different from your login password. It is asked for first, as soon as the computer starts, to unlock the disk. Without it the disk cannot be read, and it cannot be recovered, so keep it safe. Your login password is only asked for after the disk is unlocked."; color: Theme.muted; font.family: Theme.family; font.pixelSize: Theme.fontSmall; wrapMode: Text.WordWrap }
|
||||
PhoebusField { id: luksField; label: "Encryption passphrase"; secret: true; placeholder: "At least 8 characters"; error: shell.issueFor("passphrase"); onEdited: value => shell.luksPw = value }
|
||||
PhoebusField { id: luks2Field; label: "Confirm encryption passphrase"; secret: true; placeholder: "Repeat the passphrase"; error: shell.issueFor("passphrase_confirm"); onEdited: value => shell.luksPw2 = value }
|
||||
}
|
||||
PhoebusCard {
|
||||
width: parent.width
|
||||
Text { width: parent.width; text: "Desktop and options"; color: Theme.warmWhite; font.family: Theme.family; font.pixelSize: Theme.fontHeading; font.weight: Font.DemiBold }
|
||||
Text { width: parent.width; text: "Desktop"; color: Theme.muted; font.family: Theme.family; font.pixelSize: Theme.fontSmall }
|
||||
PhoebusChoice {
|
||||
options: [{ value: "mango", label: "Mango + DankMaterialShell (recommended)" }, { value: "dwl", label: "dwl (fallback)" }, { value: "none", label: "No desktop" }]
|
||||
value: shell.cfg ? shell.cfg.desktop.profile : "mango"
|
||||
onSelected: value => { shell.cfg.desktop.profile = value; shell.touchConfig(); }
|
||||
PhoebusToggle {
|
||||
label: "Use same password to encrypt disk"
|
||||
description: "Encrypts your disk with LUKS2 using your user password. When the computer starts, enter this password to unlock the drive."
|
||||
checked: shell.useSamePasswordForDisk
|
||||
onToggled: value => {
|
||||
shell.useSamePasswordForDisk = value;
|
||||
if (value) {
|
||||
shell.luksPw = shell.userPw;
|
||||
shell.luksPw2 = shell.userPw2;
|
||||
}
|
||||
}
|
||||
}
|
||||
PhoebusButton { label: shell.showAdvanced ? "Hide advanced options" : "Advanced options"; compact: true; onClicked: shell.showAdvanced = !shell.showAdvanced }
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: 12
|
||||
visible: shell.showAdvanced
|
||||
Text { width: parent.width; text: "Filesystem"; color: Theme.muted; font.family: Theme.family; font.pixelSize: Theme.fontSmall }
|
||||
PhoebusChoice {
|
||||
options: [{ value: "btrfs", label: "Btrfs (snapshots, recommended)" }, { value: "ext4", label: "ext4" }]
|
||||
value: shell.cfg ? shell.cfg.storage.filesystem : "btrfs"
|
||||
onSelected: value => { shell.cfg.storage.filesystem = value; shell.touchConfig(); }
|
||||
visible: !shell.useSamePasswordForDisk
|
||||
Text {
|
||||
width: parent.width
|
||||
text: "Enter a separate passphrase to unlock the disk at boot time. Without it the disk cannot be read or recovered."
|
||||
color: Theme.muted
|
||||
font.family: Theme.family
|
||||
font.pixelSize: Theme.fontSmall
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
Text { width: parent.width; text: "Kernel"; color: Theme.muted; font.family: Theme.family; font.pixelSize: Theme.fontSmall }
|
||||
PhoebusChoice {
|
||||
options: [{ value: "optimized", label: "Optimized" }, { value: "safe", label: "Safe (binary)" }, { value: "aggressive", label: "Aggressive" }]
|
||||
value: shell.cfg ? shell.cfg.kernel.profile : "optimized"
|
||||
onSelected: value => { shell.cfg.kernel.profile = value; shell.touchConfig(); }
|
||||
PhoebusField {
|
||||
id: luksField
|
||||
label: "Encryption passphrase"
|
||||
secret: true
|
||||
placeholder: "Enter disk passphrase"
|
||||
error: shell.issueFor("passphrase")
|
||||
onEdited: value => shell.luksPw = value
|
||||
}
|
||||
Text { width: parent.width; text: "Package policy"; color: Theme.muted; font.family: Theme.family; font.pixelSize: Theme.fontSmall }
|
||||
PhoebusChoice {
|
||||
options: [{ value: "balanced", label: "Balanced" }, { value: "source_first", label: "Source first" }, { value: "binary_first", label: "Binary first" }]
|
||||
value: shell.cfg ? shell.cfg.packages.policy : "balanced"
|
||||
onSelected: value => { shell.cfg.packages.policy = value; shell.touchConfig(); }
|
||||
PhoebusField {
|
||||
id: luks2Field
|
||||
label: "Confirm encryption passphrase"
|
||||
secret: true
|
||||
placeholder: "Repeat disk passphrase"
|
||||
error: shell.issueFor("passphrase_confirm")
|
||||
onEdited: value => shell.luksPw2 = value
|
||||
}
|
||||
PhoebusToggle { label: "Flatpak"; description: "Install Flatpak and configure Flathub"; checked: shell.cfg ? shell.cfg.desktop.flatpak : true; onToggled: value => { shell.cfg.desktop.flatpak = value; shell.touchConfig(); } }
|
||||
PhoebusToggle { label: "Nix"; description: "Second package lane for development tools"; checked: shell.cfg ? shell.cfg.packages.nix : true; onToggled: value => { shell.cfg.packages.nix = value; shell.touchConfig(); } }
|
||||
PhoebusToggle { label: "Signed binary packages"; description: "Reuse the official Gentoo binhost where USE matches"; checked: shell.cfg ? shell.cfg.packages.binary_packages : true; onToggled: value => { shell.cfg.packages.binary_packages = value; shell.touchConfig(); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1635,10 +1667,8 @@ ShellRoot {
|
|||
}
|
||||
PhoebusCard {
|
||||
width: parent.width
|
||||
Text { width: parent.width; text: "Confirm and install"; color: Theme.warmWhite; font.family: Theme.family; font.pixelSize: Theme.fontHeading; font.weight: Font.DemiBold }
|
||||
Text { width: parent.width; text: "All data on " + (shell.cfg ? shell.cfg.storage.disk : "the target") + " will be erased. This cannot be undone."; color: Theme.danger; font.family: Theme.family; font.pixelSize: Theme.fontBody; wrapMode: Text.WordWrap }
|
||||
PhoebusField { id: eraseField; label: "Type ERASE to authorize"; placeholder: "ERASE"; onEdited: value => shell.eraseText = value }
|
||||
PhoebusToggle { label: "I understand that the target disk will be erased"; checked: shell.finalConfirm; onToggled: value => shell.finalConfirm = value }
|
||||
Text { width: parent.width; text: "Ready to install"; color: Theme.warmWhite; font.family: Theme.family; font.pixelSize: Theme.fontHeading; font.weight: Font.DemiBold }
|
||||
Text { width: parent.width; text: "All data on " + (shell.cfg ? shell.cfg.storage.disk : "the target disk") + " will be replaced with Phoebus OS. Click \"Install now\" below to begin the installation."; color: Theme.muted; font.family: Theme.family; font.pixelSize: Theme.fontBody; wrapMode: Text.WordWrap }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1702,18 +1732,51 @@ ShellRoot {
|
|||
}
|
||||
}
|
||||
PhoebusButton {
|
||||
label: shell.showFailureLog ? "Hide details" : "Details (redacted log)"
|
||||
label: shell.showProgressDetails ? "Hide details" : "Show details"
|
||||
compact: true
|
||||
onClicked: {
|
||||
shell.showFailureLog = !shell.showFailureLog;
|
||||
if (shell.showFailureLog)
|
||||
Bridge.logTail(200, r => { if (r.ok) shell.logLines = r.data.lines; });
|
||||
shell.showProgressDetails = !shell.showProgressDetails;
|
||||
if (shell.showProgressDetails)
|
||||
Bridge.logTail(150, r => { if (r.ok) shell.logLines = r.data.lines; });
|
||||
}
|
||||
}
|
||||
PhoebusCard {
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
visible: shell.showFailureLog
|
||||
Text { width: parent.width; text: shell.logLines.join("\n"); color: Theme.muted; font.family: "monospace"; font.pixelSize: Theme.fontSmall; wrapMode: Text.WrapAnywhere }
|
||||
height: 220
|
||||
visible: shell.showProgressDetails
|
||||
radius: Theme.radiusSmall
|
||||
color: Theme.charcoal
|
||||
border.width: 1
|
||||
border.color: Theme.border
|
||||
clip: true
|
||||
|
||||
Flickable {
|
||||
id: logFlickable
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
contentWidth: width
|
||||
contentHeight: logText.height
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
active: true
|
||||
policy: logFlickable.contentHeight > logFlickable.height ? ScrollBar.AlwaysOn : ScrollBar.AsNeeded
|
||||
}
|
||||
|
||||
Text {
|
||||
id: logText
|
||||
width: logFlickable.width - 16
|
||||
text: shell.logLines.length > 0 ? shell.logLines.join("\n") : "Waiting for installer activity..."
|
||||
color: Theme.muted
|
||||
font.family: "monospace"
|
||||
font.pixelSize: Theme.fontSmall
|
||||
wrapMode: Text.WrapAnywhere
|
||||
onTextChanged: {
|
||||
if (logFlickable.contentHeight > logFlickable.height) {
|
||||
logFlickable.contentY = logFlickable.contentHeight - logFlickable.height;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -193,8 +193,10 @@ ShellRoot {
|
|||
implicitWidth: 300
|
||||
focus: true
|
||||
activeFocusOnTab: true
|
||||
Accessible.name: "Install Phoebus OS"
|
||||
onClicked: shell.run(["/usr/local/bin/phoebus-install"])
|
||||
onClicked: {
|
||||
shell.run(["/usr/local/bin/phoebus-install"]);
|
||||
Qt.quit();
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue