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.
This commit is contained in:
theupriser committed 2026-09-24 12:40:48 +02:00
1 parent 38c7c98eed
commit af9638ec06
3 files changed
+20 -2

No files matched your search

+11 -1
View File
@@ -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.