From 4f6e6fd0aac0b2c7d93399e2fd1879566cd96a78 Mon Sep 17 00:00:00 2001 From: rickpeters Date: Sun, 27 Sep 2026 21:59:08 +0200 Subject: [PATCH] feat: --defaults takes --skip and --boot gamescope|desktop, for the Steam Machine ISO's installer pages --- AGENTS.md | 3 +++ CHANGELOG.md | 6 +++++- lib/menu.sh | 30 ++++++++++++++++++++++++++++++ steamify.sh | 6 ++++-- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 8ae9fd8..bc33392 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -279,6 +279,9 @@ gamescope and the Plasma desktop. Primary target: the Valve Steam Machine removes it so Plasma builds Vapor's layout at the first login. What needs that layout (single user's launcher) runs then, from a one-time autostart (`lib/first-login.sh`, `--first-login`) that also opens the app. + `--skip ,...` and `--boot gamescope|desktop` (2.7.0, `defaults_options` + in `lib/menu.sh`) change the preselection through `toggle_component`, so the + menu's dependencies hold; the ISO's installer pages pass them. - `Relogin=true` means a gamescope that fails to start is relaunched in a tight loop; keep that in mind when changing session handling. diff --git a/CHANGELOG.md b/CHANGELOG.md index 2befe61..ee03979 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,13 @@ All notable changes, per version and per commit. Versions follow `steamify.sh`. Versions before 0.7.0 were numbered afterwards, one per merged pull request. +## 2.7.0 - 2026-09-27 + +- **feat: --defaults takes --skip and --boot gamescope|desktop, for the Steam Machine ISO's installer pages** + ## 2.6.0 - 2026-09-27 -- **feat: --defaults applies the default setup without the menu, also from an installer (no session): the base for a Steam Machine ISO** +- `b948c20` **feat: --defaults applies the default setup without the menu, also from an installer (no session): the base for a Steam Machine ISO** ## 2.5.2 - 2026-09-27 diff --git a/lib/menu.sh b/lib/menu.sh index e9b6200..f59ee2b 100644 --- a/lib/menu.sh +++ b/lib/menu.sh @@ -179,6 +179,36 @@ detect_components() { fi } +defaults_options() { + # defaults_options [--skip [,...]] [--boot gamescope|desktop]: + # changes --defaults' preselection like unticking items in the menu + # (the Steam Machine ISO's installer pages pass them). Returns 1 on an + # unknown option or id. + local c ids + while [[ $# -gt 0 ]]; do + case "$1" in + --skip) + IFS=, read -ra ids <<< "${2:-}" + for c in "${ids[@]}"; do + [[ -n "${LABEL[$c]:-}" ]] || { err "Unknown item: $c"; return 1; } + # Unticking through the menu's rules: e.g. skipping the + # conversion also skips single user mode. + [[ "${WANTED[$c]:-0}" == 1 ]] && toggle_component "$c" + done + shift 2 ;; + --boot) + case "${2:-}" in + gamescope) [[ "${WANTED[boot]:-0}" == 1 ]] && toggle_component boot ;; + desktop) [[ "${WANTED[boot]:-0}" == 0 && "${WANTED[gaming]:-0}" == 1 ]] && toggle_component boot ;; + *) err "--boot takes gamescope or desktop"; return 1 ;; + esac + shift 2 ;; + *) err "Unknown option: $1"; return 1 ;; + esac + done + return 0 +} + toggle_component() { local c="$1" component_selectable "$c" || return 1 diff --git a/steamify.sh b/steamify.sh index 1290d59..5a7828f 100755 --- a/steamify.sh +++ b/steamify.sh @@ -15,7 +15,7 @@ set -uo pipefail # Release version, see CHANGELOG.md. -VERSION=2.6.0 +VERSION=2.7.0 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -28,7 +28,8 @@ require_root_helper BACKEND=false [[ "${1:-}" == --backend ]] && BACKEND=true -# --defaults: apply what the menu would preselect, without the menu or any +# --defaults [--skip ,...] [--boot gamescope|desktop]: apply what the +# menu would preselect (minus the skipped items), without the menu or any # prompt (the Steam Machine ISO's first login runs this; sudo must not ask). DEFAULTS=false [[ "${1:-}" == --defaults ]] && DEFAULTS=true @@ -128,6 +129,7 @@ if [[ "$DEFAULTS" == true ]]; then REAPPLY=false sudo -n true 2>/dev/null || { err "--defaults needs sudo without a password."; exit 1; } detect_components + defaults_options "${@:2}" || exit 1 plan_changes apply_changes # Run by the installer: the rest waits for the first desktop login.