From 4895de3a46b175f262736056e456be59c3562e4b Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Thu, 24 Sep 2026 13:27:02 +0200 Subject: [PATCH] feat: "Boot into" is a sub-option of the conversion Shown indented under the SteamOS conversion, and only while it's ticked. --- AGENTS.md | 4 +++- CHANGELOG.md | 4 +++- README.md | 7 ++++--- lib/menu.sh | 20 +++++++++++++++----- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 2f41ba5..d109e00 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -133,7 +133,9 @@ gamescope and the Plasma desktop. Primary target: the Valve Steam Machine pacman hook can't run pacman), which triggers DKMS's install hook. The module creates `/sys/class/leds/valve-leds*`. - `boot` ("Boot into: [gamescope] / desktop") is a choice row, not a - checkbox: on = desktop. It needs `gaming` (ticking it ticks gaming, + checkbox: on = desktop. It's a sub-option of the conversion: `menu_visible` + only shows it (indented, `└`) while `gaming` is ticked, so menu numbers + after it shift by one when the conversion is unticked. It needs `gaming` (ticking it ticks gaming, unticking gaming unticks it) and is never preselected (`NO_PRESELECT`), so the conversion boots into gamescope by default. Desktop is `steamify-boot-desktop.service`, ordered `Before=` the login managers: diff --git a/CHANGELOG.md b/CHANGELOG.md index d5c5652..c4972c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ one per merged pull request. ## 0.10.0 - 2026-09-24 -- **feat: Boot into gamescope or the desktop** +- `0f503dd` **feat: Boot into gamescope or the desktop** - New menu row under the conversion, "Boot into: [gamescope] / desktop"; gamescope stays the default and is never changed on a first run. - Desktop: `steamify-boot-desktop.service` sets the autologin session to @@ -16,6 +16,8 @@ one per merged pull request. it. Choosing desktop turns the conversion on; turning the conversion off resets it to gamescope. - The later menu items move down one (BIOS is now 8 on a Steam Machine). +- **feat: "Boot into" is a sub-option of the conversion** + - Shown indented under the SteamOS conversion, and only while it's ticked. ## 0.9.1 - 2026-09-24 (#10) diff --git a/README.md b/README.md index abdac14..6e2587b 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,10 @@ Everything you turn off is put back the way it was. Desktop** in Steam works and so does going back (the **Return to Gaming Mode** icon on the desktop), you're back in gaming mode after a restart, and Steam's on-screen keyboard (Steam + X) also works on the desktop. -2. **Boot into: [gamescope] / desktop** - where the PC starts. Gamescope - (gaming mode) is the default; choose desktop to start in KDE Plasma - instead, with Return to Gaming Mode one double-click away. (Needs 1.) +2. **Boot into: [gamescope] / desktop** - a sub-option of 1, shown under it + while it's ticked: where the PC starts. Gamescope (gaming mode) is the + default; choose desktop to start in KDE Plasma instead, with Return to + Gaming Mode one double-click away. 3. **SteamOS theme** - the Vapor look for the desktop (CachyOS's `cachyos-vapor` package). 4. **Steam Deck/Machine icons** - Steam Deck button icons in gaming mode. diff --git a/lib/menu.sh b/lib/menu.sh index 0e22a73..e053724 100644 --- a/lib/menu.sh +++ b/lib/menu.sh @@ -34,6 +34,13 @@ component_available() { is_action() { [[ " ${ACTIONS[*]} " == *" $1 "* ]]; } +menu_visible() { + # Shown in the menu. "Boot into" is a sub-option of the conversion: only + # while the conversion is ticked. + component_available "$1" || return 1 + [[ "$1" != boot || "${WANTED[gaming]:-0}" == 1 ]] +} + component_selectable() { # Greyed out and not tickable when it has nothing to do. case "$1" in @@ -76,7 +83,7 @@ show_menu() { printf " ${c_bold}%-3s %-6s %-6s %s${c_reset}\n" "#" "Now" "Want" "Component" MENU_ITEMS=() for c in "${COMPONENTS[@]}"; do - component_available "$c" || continue + menu_visible "$c" || continue i=$((i + 1)); MENU_ITEMS[$i]=$c # Pad the plain word, then colour it: colour codes would count as width. now="off"; [[ "${CURRENT[$c]}" == 1 ]] && now="on" @@ -89,7 +96,7 @@ show_menu() { now="gaming"; [[ "${CURRENT[boot]}" == 1 ]] && now="desk" [[ "${CURRENT[gaming]}" == 1 ]] || now="-" want="gaming"; [[ "${WANTED[boot]}" == 1 ]] && want="desk" - printf " %-3s %-6s %-6s %s\n" "$i" "$now" "$want" "$(boot_choice "${WANTED[boot]}")" + printf " %-3s %-6s %-6s └ %s\n" "$i" "$now" "$want" "$(boot_choice "${WANTED[boot]}")" elif component_selectable "$c"; then printf " %-3s %b %-6s %s\n" "$i" "$now" "$want" "${LABEL[$c]}" else @@ -122,7 +129,7 @@ draw_menu_tui() { echo MENU_ITEMS=() for c in "${COMPONENTS[@]}"; do - component_available "$c" || continue + menu_visible "$c" || continue MENU_ITEMS[$i]=$c box="[ ]"; [[ "${WANTED[$c]}" == 1 ]] && box="[${c_green}x${c_reset}]" state=" (now: off)"; [[ "${CURRENT[$c]}" == 1 ]] && state=" (now: ${c_green}on${c_reset})" @@ -130,10 +137,11 @@ draw_menu_tui() { line="$box ${LABEL[$c]}" if [[ "$c" == boot ]]; then # A choice rather than a checkbox; Space switches it. + # Indented under the conversion, whose sub-option it is. line="$(boot_choice "${WANTED[boot]}")" - line="${line/\[/[${c_green}}"; line="${line/\]/${c_reset}]}" + line=" └ ${line/\[/[${c_green}}"; line="${line/\]/${c_reset}]}" state=" (now: gamescope)"; [[ "${CURRENT[boot]}" == 1 ]] && state=" (now: desktop)" - [[ "${CURRENT[gaming]}" == 1 ]] || state=" (with the SteamOS conversion)" + [[ "${CURRENT[gaming]}" == 1 ]] || state="" fi if ! component_selectable "$c"; then # Greyed out: nothing to do (e.g. BIOS already up to date). @@ -160,6 +168,8 @@ run_menu_tui() { while true; do draw_menu_tui "$cursor" count=${#MENU_ITEMS[@]} + # The list shrinks when the conversion (and its sub-option) is unticked. + if (( cursor >= count )); then cursor=$(( count - 1 )); draw_menu_tui "$cursor"; fi IFS= read -rsn1 key if [[ "$key" == $'\e' ]]; then IFS= read -rsn2 -t 0.05 rest