feat: --defaults takes --skip <ids> and --boot gamescope|desktop, for the Steam Machine ISO's installer pages

This commit is contained in:
theupriser committed 2026-09-27 21:59:08 +02:00
1 parent ad3b872437
commit 540549b828
4 files changed
+42 -3

No files matched your search

+3
View File
@@ -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 <id>,...` 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.
+5 -1
View File
@@ -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 <ids> 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
+30
View File
@@ -179,6 +179,36 @@ detect_components() {
fi
}
defaults_options() {
# defaults_options [--skip <id>[,<id>...]] [--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
+4 -2
View File
@@ -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 <id>,...] [--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.