mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-06 07:00:14 +02:00
Plasma 6.2.5 keeps a panel on a screen number and never moves one whose number is past the screen count, so a taskbar saved on a spare output (#18, lastScreen=8 with three screens) or on a screen a smaller layout dropped stayed hidden. Before Plasma starts, session/fix-panels.py moves such a panel and its tray's containment to screen 0 (the primary), keeping its widgets, unless screen 0 already has a panel on that edge. doctor.sh checks the panels' screens, and report.sh lists them with the live outputs and panels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
2.2 KiB
Bash
Executable File
51 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Check that the Steam Frame is ready for these projects: reachable (from a PC), the
|
|
# distrobox tool and the dev container present, and disk space. Then check what Frametop
|
|
# needs from SteamOS, which an update can change (scripts/update-check.py). Works on the
|
|
# Frame too.
|
|
# Usage: scripts/doctor.sh [--mark-good]
|
|
# --mark-good once Frametop works, record the SteamOS, SteamVR, and KWin versions, so a
|
|
# later run says what an update changed
|
|
set -uo pipefail
|
|
|
|
. "$(dirname "${BASH_SOURCE[0]}")/_env.sh"
|
|
|
|
fail=0
|
|
check() {
|
|
local label=$1; shift
|
|
if out=$("$@" 2>&1); then
|
|
printf 'ok %s%s\n' "$label" "${out:+: $out}"
|
|
else
|
|
printf 'FAIL %s%s\n' "$label" "${out:+: $out}"
|
|
fail=1
|
|
fi
|
|
}
|
|
|
|
if [ "$FRAME_LOCAL" = 1 ]; then
|
|
echo "running on the Frame: $FRAME_REPO"
|
|
else
|
|
check "ssh key loaded" bash -c 'ssh-add -l | grep -c . | sed "s/$/ key(s)/"'
|
|
check "ssh to $FRAME_HOST" ssh -o BatchMode=yes -o ConnectTimeout=8 "$FRAME_HOST" true
|
|
if [ "$fail" = 1 ]; then
|
|
echo "Skipping device checks. Is the headset on and awake, and on the network?"
|
|
exit 1
|
|
fi
|
|
fi
|
|
check "SteamOS" on_frame '. /etc/os-release; echo "$PRETTY_NAME $VERSION_ID build $BUILD_ID, $(uname -m)"'
|
|
check "distrobox" on_frame 'test -x ~/.local/bin/distrobox && ~/.local/bin/distrobox version | head -1'
|
|
check "container $FRAME_BOX" on_frame "podman ps -a --filter name=^$FRAME_BOX\$ --format '{{.Image}} {{.Status}}' | grep ."
|
|
check "repo on the Frame" on_frame 'pwd'
|
|
check "free space in ~" on_frame "df -h ~ | awk 'NR==2{print \$4\" free\"}'"
|
|
# A taskbar saved on a screen the desktop doesn't have is hidden; the desktop's next start
|
|
# moves it to the first screen (session/fix-panels.py).
|
|
check "taskbar on a screen" on_frame 'set -o pipefail; [ -f session/fix-panels.py ] || { echo "not checked (older checkout)"; exit 0; }
|
|
python3 session/fix-panels.py --check | paste -sd ";" | sed "s/;/; /g"'
|
|
|
|
echo "what Frametop needs from SteamOS:"
|
|
if [ "$FRAME_LOCAL" = 1 ]; then
|
|
python3 "$REPO_ROOT/scripts/update-check.py" "$@" || fail=1
|
|
else
|
|
ssh -o BatchMode=yes "$FRAME_HOST" "python3 - ${*:+$(printf '%q ' "$@")}" < "$REPO_ROOT/scripts/update-check.py" || fail=1
|
|
fi
|
|
exit "$fail"
|