feat: Release testing, cleaner resets and screenshots; skill updates

- vmwatch.sh --release: run the newest GitHub release in the VM.
- vmreset.sh: skip the broken krfoss mirror, install shellcheck.
- vmshot.sh --clean: close Steam, CachyOS Hello and Konsole first.
- Skill: items 1-7, menu loop and restart question, current inputs, finish on a fresh snapshot, release testing, Steamify shortcut, zsh pitfall.
This commit is contained in:
theupriser committed 2026-09-24 13:06:23 +02:00
1 parent 8c48858f54
commit f27dd866a1
6 files changed
+124 -34

No files matched your search

+7 -1
View File
@@ -1,7 +1,8 @@
#!/bin/bash
# Reset the test VM to a snapshot and bring it up logged in to Plasma:
# power off, restore the snapshot (disk + vars.fd), start it, mount the repo
# on /mnt, set up the test autologin and wait for plasmashell.
# on /mnt, set up the test autologin and wait for plasmashell; also skips
# the broken krfoss mirror and installs shellcheck.
# scripts/vmreset.sh [run.sh flags...] e.g. scripts/vmreset.sh --fremont
# Env: VM_USER / VM_PORT / VM_HOST, SNAPSHOT (ssh-ready),
# VM_DIR (where disk.qcow2 lives: this repo if it has one, else ~/vms/cachyos-test),
@@ -41,5 +42,10 @@ for _ in $(seq 40); do pgrep -u "$USER" -x plasmashell >/dev/null && break; slee
sleep 10
# Windows the snapshot opens at login would cover the screenshots.
pkill -u "$USER" systemsettings; pkill -u "$USER" cachyos-hello
# mirror5.krfoss.org served a broken .sig ("Maximum file size exceeded"),
# which fails the conversion's package install; skip it.
for f in /etc/pacman.d/*mirrorlist*; do sudo sed -i '/krfoss/s/^Server/#Server/' "$f"; done
# shellcheck, for checking the bundle like CI does (not in the snapshot).
sudo pacman -S --needed --noconfirm shellcheck >/dev/null 2>&1 || echo "Couldn't install shellcheck." >&2
pgrep -u "$USER" -x plasmashell >/dev/null && echo "Logged in to Plasma." || { echo "Plasma did not start." >&2; exit 1; }
REMOTE
+14 -3
View File
@@ -1,15 +1,26 @@
#!/bin/bash
# Screenshot the guest's Plasma session to a file on the host.
# scripts/vmshot.sh <out.png>
# scripts/vmshot.sh [--clean] <out.png>
# --clean first close what starts with the session and covers the desktop
# (Steam, CachyOS Hello) and the wizard's Konsole.
# spectacle started straight from SSH crashes; run it as a user unit so it
# gets the session's environment.
# Env: VM_USER (theupriser), VM_PORT (2222), VM_HOST (localhost), GUEST_UID (1000).
set -euo pipefail
. "$(dirname "$0")/common.sh"
out="${1:?usage: $0 <out.png>}"
{ printf 'uid=%q\n' "${GUEST_UID:-1000}"; cat << 'REMOTE'
clean=""
[[ "${1:-}" == --clean ]] && { clean=1; shift; }
out="${1:?usage: $0 [--clean] <out.png>}"
{ printf 'uid=%q clean=%q\n' "${GUEST_UID:-1000}" "$clean"; cat << 'REMOTE'
export XDG_RUNTIME_DIR=/run/user/$uid DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus
rm -f /tmp/vmshot.png
if [ -n "$clean" ]; then
# Steam as a whole: closing only its web helper leaves a black window.
# It comes back at the next login (steam-desktop-autostart).
steam -shutdown >/dev/null 2>&1 & sleep 5; pkill -u "$USER" -x steam; pkill -u "$USER" -x steamwebhelper
pkill -u "$USER" cachyos-hello; pkill -u "$USER" -x konsole
sleep 2
fi
sleep 2
systemd-run --user --wait -q spectacle -b -n -f -o /tmp/vmshot.png
REMOTE
+19 -6
View File
@@ -2,24 +2,37 @@
# Like vmrun.sh, but run the wizard in a visible Konsole window inside the
# guest's Plasma session, so someone at the QEMU window can follow along.
# Waits for the wizard to finish, then prints its log. The window stays open.
# scripts/vmwatch.sh '<menu input>' ["label shown in the window"]
# scripts/vmwatch.sh [--release] '<menu input>' ["label shown in the window"]
# --release run the newest release from GitHub instead of the mounted repo
# (downloaded; WIZARD_KEEP_STDIN=1 keeps the piped menu input).
# Env: VM_USER (theupriser), VM_PORT (2222), VM_HOST (localhost),
# GUEST_REPO (/mnt), GUEST_UID (1000), WAIT (seconds, default 1800).
set -euo pipefail
. "$(dirname "$0")/common.sh"
input="${1:?usage: $0 '<menu input>' [label]}"
release=""
[[ "${1:-}" == --release ]] && { release=1; shift; }
input="${1:?usage: $0 [--release] '<menu input>' [label]}"
label="${2:-Running the wizard}"
# The guest login shell is fish, so pass values in through the bash script itself.
{ printf 'input=%q label=%q repo=%q uid=%q wait=%q\n' "$input" "$label" "${GUEST_REPO:-/mnt}" \
"${GUEST_UID:-1000}" "${WAIT:-1800}"; cat << 'REMOTE'
{ printf 'input=%q label=%q repo=%q uid=%q wait=%q release=%q\n' "$input" "$label" "${GUEST_REPO:-/mnt}" \
"${GUEST_UID:-1000}" "${WAIT:-1800}" "$release"; cat << 'REMOTE'
export XDG_RUNTIME_DIR=/run/user/$uid DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus
[ -x "$repo/steamify.sh" ] || { echo "$repo/steamify.sh missing: mount the repo (lost after a reboot)" >&2; exit 1; }
if [ -n "$release" ]; then
wizard=/tmp/steamify-release.sh
curl -fsSL https://github.com/theupriser/steamify-cachyos/releases/latest/download/steamify.sh -o "$wizard" ||
{ echo "Couldn't download the newest release." >&2; exit 1; }
run="WIZARD_KEEP_STDIN=1 bash $wizard"
label="$label ($(grep -m1 '^VERSION=' "$wizard") from GitHub)"
else
[ -x "$repo/steamify.sh" ] || { echo "$repo/steamify.sh missing: mount the repo (lost after a reboot)" >&2; exit 1; }
run="$repo/steamify.sh"
fi
rm -f /tmp/wizard.done
{
echo '#!/bin/bash'
printf 'echo %q; echo %q; sleep 3\n' ">>> $label" ">>> menu input: $input"
# shellcheck disable=SC2016
printf 'printf %q | %q 2>&1 | tee /tmp/wizard.log\n' "$input" "$repo/steamify.sh"
printf 'printf %q | %s 2>&1 | tee /tmp/wizard.log\n' "$input" "$run"
echo 'touch /tmp/wizard.done'
} > /tmp/vmwatch-run.sh
chmod +x /tmp/vmwatch-run.sh