From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id E8042B07A; Sun, 11 Jan 2026 18:30:39 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 41E63B070; Sun, 11 Jan 2026 18:30:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by atuin.qyliss.net (Postfix) with ESMTPS id 751A5B06B for ; Sun, 11 Jan 2026 18:30:36 +0000 (UTC) Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4dq3wV063Bz9spx; Sun, 11 Jan 2026 19:30:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1768156234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FRGKuEgITXMMx5Ub5pYikw4FQH52vhaC5Cqesu1wQRY=; b=o4rr3RMu6S0b2Bu4JoCVb+y+LZDH6qFL+aM60WdxEzmYT3Cd/mZR2PPdP4GMSqmzqHwnAI 52yzdb1MPPtDlQbP/TgellJ0hckTZvUYCHM9U7HSZ84y3UuFeYyR/3oNYIu9kdt3AcEex0 3kX53CrnKP9C6Y5aTa5gHpfMl+QBSb6R1LdfHa1/Wq1waJEUU4d+SN/B1tXz+NXfYy+EGZ VAWIoqrorSkQ3j54QKVLdCmZRHi2MaoDQ5mey1oGRYM1v5DVEswTiW+HhNpQepn5PFDuSQ HAPaaTK1r5ty/zJkMrX0nF5nZzbsm7kIMIG/uSWSgTf+v6ooUbVQmQZNLvueXw== Authentication-Results: outgoing_mbo_mout; dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=MytsK8eJ; spf=pass (outgoing_mbo_mout: domain of johannes.suellner@mailbox.org designates 2001:67c:2050:b231:465::202 as permitted sender) smtp.mailfrom=johannes.suellner@mailbox.org Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1768156231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FRGKuEgITXMMx5Ub5pYikw4FQH52vhaC5Cqesu1wQRY=; b=MytsK8eJEdXPsabmhIO6kLEF2qk0SZWZTqGKQp6XndPT6Hkly29n67PF/M72hRMMOIb+eS +NsFySLMIKmEviIugVdeoGvqqR9i7buo/6jgZMlRHdcauqt/nOo+5sFAFpO7hcF2YHjhBl EO4UV3g7pClYGkakrUlTWU04B2b8dviyodNlY0/7h8pp/acui1la/wGgAghetxiBv00UAj bw6HxOyTR60GTjPS7YKUXf6Z2Cg5HUBA8NJKPsimuYEoeOgtUp4XiwlPJZIGmsbdisC3li dCoGuWH/PcN/jI/e8JpqS2zeWs2DO+Y7BNFQJBjIacpbasnx6DIwfE8nC2QP8Q== Content-Type: multipart/signed; boundary=8352761bf181e9022a76306490b1040ed79af32b9b3d31e0c3d9b1a2a827; micalg=pgp-sha512; protocol="application/pgp-signature" Date: Sun, 11 Jan 2026 19:30:22 +0100 Message-Id: Subject: Re: [PATCH 1/4] tools: add spectrum-installer To: "Demi Marie Obenour" , =?utf-8?q?Johannes_S=C3=BCllner?= , From: =?utf-8?q?Johannes_S=C3=BCllner?= References: <20260104140102.106960-5-johannes.suellner@mailbox.org> In-Reply-To: X-MBO-RS-ID: 5a1a61a808f479fae9e X-MBO-RS-META: eect54ui877kba9o4qk69pqwfpmorfni X-Rspamd-Queue-Id: 4dq3wV063Bz9spx Message-ID-Hash: UXY65FJ3YAJMAZV3XXUUVM24JI57UMVO X-Message-ID-Hash: UXY65FJ3YAJMAZV3XXUUVM24JI57UMVO X-MailFrom: johannes.suellner@mailbox.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --8352761bf181e9022a76306490b1040ed79af32b9b3d31e0c3d9b1a2a827 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 On Sun Jan 4, 2026 at 10:13 PM CET, Demi Marie Obenour wrote: > On 1/4/26 09:00, Johannes S=C3=BCllner wrote: >> Written in Rust using the Iced GUI library. Uses `lsblk-rs` to offer a >> list of disks where the user can choose one to install Spectrum on. >> Uses `systemd-repart` for the installation, which is running in an >> embedded terminal window using `iced-term`. >>=20 >> Signed-off-by: Johannes S=C3=BCllner >> --- ... >> diff --git a/tools/spectrum-installer/shell.nix b/tools/spectrum-install= er/shell.nix >> new file mode 100644 >> index 0000000..060009b >> --- /dev/null >> +++ b/tools/spectrum-installer/shell.nix >> @@ -0,0 +1,30 @@ >> +# SPDX-License-Identifier: MIT >> +# SPDX-FileCopyrightText: 2025 iced contributors >> + >> +# from https://github.com/iced-rs/iced/blob/master/DEPENDENCIES.md >> +# last updated 2025-11-11 >> +{ pkgs ? import {} }: >> + >> +pkgs.mkShell rec { >> + buildInputs =3D with pkgs; [ >> + cargo >> + lldb >> + expat >> + fontconfig >> + freetype >> + freetype.dev >> + libGL >> + pkg-config >> + rustfmt >> + xorg.libX11 >> + xorg.libXcursor >> + xorg.libXi >> + xorg.libXrandr >> + wayland >> + libxkbcommon >> + ]; > > Is it possible to drop the X11 libraries? The installer should be > Wayland-only. If upstream Iced can't be built without X11 support, > feel free to ignore this. Yes, it is possible to drop them. I just did not tried until now, but building without them in a `nix-shell --pure` environment works. They are gone now; I also updated the whole develompent shell file as the upstream reference (https://github.com/iced-rs/iced/blob/master/DEPENDE= NCIES.md) also changed. >> diff --git a/tools/spectrum-installer/src/main.rs b/tools/spectrum-insta= ller/src/main.rs >> new file mode 100644 >> index 0000000..2ca9dfa >> --- /dev/null >> +++ b/tools/spectrum-installer/src/main.rs >> @@ -0,0 +1,52 @@ >> +// SPDX-License-Identifier: EUPL-1.2+ >> +// SPDX-FileCopyrightText: 2025 Johannes S=C3=BCllner >> + >> +mod pages; >> + >> +use iced::Element; >> +use iced::Size; >> +use iced::Subscription; >> +use iced::Task; >> +use pages::Event; >> + >> +fn main() -> iced::Result { >> + iced::application( >> + "Spectrum installer", >> + SpectrumInstaller::update, >> + SpectrumInstaller::view, >> + ) >> + .window_size(Size::new(pages::WINDOW_WIDTH, pages::WINDOW_HEIGHT)) >> + .font(iced_fonts::BOOTSTRAP_FONT_BYTES) >> + .resizable(false) >> + .subscription(SpectrumInstaller::subscription) >> + .run() >> +} > > Have you tested with HiDPI displays? I think it would be better for > the installer to be fullscreen, or at least have a size proportional > to the display it is on. > > I suspect that hard-coded sizes are an antipattern, though I don't know > what the best alternative would be. Ideally there would be an option > to zoom in and out, so that those who need larger buttons and text can > get that. Is there a way to ask Iced to size things automatically? I did not test on a HiDPI screen this before, but did so now and it would scale just fine in latest PopOS with Cosmic. I agree a large font mode or zoom-options would be good for accessibility. I'm happy to implement this at some future point. Personally, I do not like fullscreen installers too much, perhaps because I think there is not enough content that would justify fullscreen. Not a strong opinion though. As a sidenote, resizing of the installer already causes the widgets to resize as well (font size stays the same, though). You can currently resize the window in Weston, where the application's wish to not be resizable is not honored. >> diff --git a/tools/spectrum-installer/src/pages/completion.rs b/tools/sp= ectrum-installer/src/pages/completion.rs >> new file mode 100644 >> index 0000000..2ea9734 >> --- /dev/null >> +++ b/tools/spectrum-installer/src/pages/completion.rs ... >> + fn view(&self) -> Element<'_, Event> { >> + let main_element =3D match &self.install_result { >> + Ok(_) =3D> { >> + center_in_container!(text("Spectrum installation succee= ded!").size(TITLE_TEXT_SIZE)).into() >> + } >> + Err((code, log)) =3D> { >> + column![ >> + Space::with_height(MARGIN_VERTICAL), >> + center_horizontal_in_container!(text("Spectrum inst= allation failed :( ").size(TITLE_TEXT_SIZE)), >> + Space::with_height(MARGIN_VERTICAL), >> + center_horizontal_in_container!(Scrollable::new(tex= t(format!("You can reach out to the team via Chat or the \"discuss\" mailin= g list.\n\ >> + See https://spectrum-os.org/doc/contributing/co= mmunication.html for details.\n\ >> + The following information may be relevant:\n\n\ >> + Error code: {}\n\nError log:\n{}", code, log))) >> + .width(WINDOW_WIDTH - 2.0 * MARGIN_LR) >> + .height(500) >> + .direction(Direction::Vertical(Scrollbar::new()= ))), >> + ] >> + .into() >> + } >> + }; > > I see no harm in including the full email address of the discuss > mailing list (discuss@spectrum-os.org). Also, it would be useful to > display a QR code that someone can scan using their mobile device. > This avoids having to do clumsy and error-prone manual transcription, > and may allow for including more lines of output. I guess you're right, I've included the full email address now. I like your idea to have a QR code for the error log and just implemented it. >> + String::from( >> + [ >> + "( /usr/bin/systemd-repart \ >> + --definitions=3D/usr/share/spectrum-in= staller/repart.d \ >> + --empty=3Dforce \ >> + --dry-run=3Dno ", >> + &device.fullname.display().to_string(), > > Missing shell argument escaping and '-o pipefail'. The latter might > require bash instead of sh. Good catch, fixed. Works with sh as well. >> diff --git a/tools/spectrum-installer/src/pages/layout.rs b/tools/spectr= um-installer/src/pages/layout.rs >> new file mode 100644 >> index 0000000..e7095bd >> --- /dev/null >> +++ b/tools/spectrum-installer/src/pages/layout.rs ... >> + >> +pub fn disk_element(device: &BlockDevice) -> Element<'static, Event> { >> + let icon: Element =3D text(Icon::Hdd.to_string()) >> + .font(ICON_FONT) >> + .size(DISK_ICON_SIZE) >> + .into(); >> + >> + let disk_size =3D if let Ok(Some(capacity)) =3D device.capacity() { >> + let mut size_factor: f32 =3D (capacity * 512) as f32; > > Why f32 and not f64? No particular reason, I changed it to f64. >> diff --git a/tools/spectrum-installer/src/pages/mod.rs b/tools/spectrum-= installer/src/pages/mod.rs >> new file mode 100644 >> index 0000000..cd020f1 >> --- /dev/null >> +++ b/tools/spectrum-installer/src/pages/mod.rs >> @@ -0,0 +1,43 @@ >> +// SPDX-License-Identifier: EUPL-1.2+ >> +// SPDX-FileCopyrightText: 2025 Johannes S=C3=BCllner >> + >> +use iced::{Subscription, Task}; >> + >> +mod completion; >> +mod confirmation; >> +mod disk_selection; >> +mod installation; >> +mod layout; >> +mod welcome; >> + >> +pub const WINDOW_WIDTH: f32 =3D 750.0; >> +pub const WINDOW_HEIGHT: f32 =3D 650.0; >> + >> +pub const MARGIN_VERTICAL: f32 =3D 25.0; >> +pub const MARGIN_LR: f32 =3D 15.0; > > Why f32 and not f64? Iced expects 32 bit floats for sizes. --8352761bf181e9022a76306490b1040ed79af32b9b3d31e0c3d9b1a2a827 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iJQEABYKADwWIQRA5WQPqMdjpQBqXRS/VewHMjGgVAUCaWPsQR4cam9oYW5uZXMu c3VlbGxuZXJAbWFpbGJveC5vcmcACgkQv1XsBzIxoFQDMwD/d3AplIKAftbRu/ui op+CJKGA0yw1aCltnqjOlzLm5KwA/ipSj0eDYoQsj7hcYK2WDwPTK6KSAgedfUTn YA1yp9AB =ZYVw -----END PGP SIGNATURE----- --8352761bf181e9022a76306490b1040ed79af32b9b3d31e0c3d9b1a2a827--