From af9638ec06b5bed2182f5a4caca0f5d7dc06ce49 Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Thu, 24 Sep 2026 12:40:48 +0200 Subject: [PATCH] feat: The shortcut's window closes itself after a countdown - 10-second countdown after the wizard ends (Enter closes right away); after an error it waits for Enter. - pipefail, so a failed download counts as an error. --- AGENTS.md | 3 +++ CHANGELOG.md | 7 ++++++- lib/wizard-shortcut.sh | 12 +++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index adaf095..b37b470 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -156,6 +156,9 @@ gamescope and the Plasma desktop. Primary target: the Valve Steam Machine downloaded from there (Steam's icon if that fails). Desktop files are written with their mode already set (`install_executable`): Plasma opens a desktop icon it first saw non-executable in an editor. + The start script closes its window after a 10-second countdown on success + and waits for Enter after an error; it uses `pipefail`, or a failed + download would run an empty script and count as success. - `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 dd9ac98..21fba5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,12 @@ itself on the desktop. - `setup-gamescope-boot.sh` is renamed to `steamify.sh`; releases publish the bundle under both names, so `.../download/setup-gamescope-boot.sh` keeps working. The Steamify shortcut runs `steamify.sh`. -- **docs: Shorter README intro** +- `b0553ae` **docs: Shorter README intro** +- **feat: The shortcut's window closes itself after a countdown** + - After the wizard ends, a 10-second countdown closes the Konsole window + (Enter closes it right away); after an error it stays open until Enter. + - A failed download now counts as an error (`pipefail`) instead of running + an empty script. ## 0.8.0 - 2026-09-24 (#8) diff --git a/lib/wizard-shortcut.sh b/lib/wizard-shortcut.sh index ba2eb64..6a3a9fd 100644 --- a/lib/wizard-shortcut.sh +++ b/lib/wizard-shortcut.sh @@ -37,12 +37,22 @@ launcher_enable() { install_executable "$WIZARD_LAUNCHER" 755 << EOF #!/bin/bash # Installed by Steamify CachyOS: run its newest release. +# pipefail: a failed download must count as a failure, not an empty script. +set -o pipefail if ! curl -fsSL --max-time 30 "$WIZARD_URL" | bash; then echo echo "Couldn't download or run the wizard. Are you connected to the internet?" + echo + read -rp "Press Enter to close this window... " _ + exit 1 fi +# Done: close the window after a countdown (Enter closes it right away). +echo +for (( i = 10; i > 0; i-- )); do + printf '\rClosing this window in %2d seconds (Enter to close now)... ' "\$i" + read -rs -t 1 _ && break +done echo -read -rp "Press Enter to close this window... " _ EOF # The icon comes with the release; without it, Steam's own icon.