mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-06 05:00:08 +02:00
FrameDrop sideloads a Linux zip as a Steam Devkit Game. Frametop can't be copied over as an app, so the zip holds a small installer: playing it runs get.sh --yes in a transient user service (Steam reaps the title's process tree on quit) and shows progress in a GTK window. - probe/probe.sh records what a Devkit Game can reach. On SteamOS 0.3.0 it runs on the host with git, podman, systemd and GTK, even with the SLR4 compat tool set; inside SLR4, flatpak-spawn --host reaches the host. - devkit.sh registers a folder the way FrameDrop does (Valve's devkit-utils), for testing without a PC. - build.sh makes a reproducible Frametop.zip and the FrameDrop manifest. Nothing is published. Open: whether FrameDrop keeps the exec bit, and its start command and runtime choice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59 lines
2.7 KiB
Bash
Executable File
59 lines
2.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Frametop's FrameDrop installer: the start command of the "Frametop" title that FrameDrop
|
|
# puts in the Steam library. Playing it installs Frametop (or updates it) with the one-line
|
|
# installer, get.sh --yes, and shows its progress in a window.
|
|
#
|
|
# Steam ends a title's whole process tree when it's quit, and starts it with a high OOM score,
|
|
# so the install runs in a user service of its own (frametop-framedrop-install) and the window
|
|
# only follows its log. Quitting or closing the window leaves the install running; playing the
|
|
# title again reattaches to it.
|
|
#
|
|
# Usage: frametop-install.sh [--dry-run]
|
|
# --dry-run clone into ~/.cache/frametop-framedrop/dry-run instead of ~/frametop, and
|
|
# don't run install.sh (get.sh --clone-only), for testing this flow
|
|
set -u
|
|
|
|
here=$(cd "$(dirname "$0")" && pwd)
|
|
self=$here/$(basename "$0")
|
|
|
|
# A Linux title can be started in the Steam Linux Runtime container, which has no git, podman,
|
|
# systemctl, or GTK. Start this again on the host. (SteamOS 0.3.0 runs devkit titles on the
|
|
# host anyway; this is for when FrameDrop or Steam picks the runtime.)
|
|
if [ -e /run/pressure-vessel ]; then
|
|
exec flatpak-spawn --host --watch-bus --env=DISPLAY="${DISPLAY-}" \
|
|
--env=XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR-}" --env=SteamAppId="${SteamAppId-}" \
|
|
--env=ENABLE_GAMESCOPE_WSI="${ENABLE_GAMESCOPE_WSI-}" /usr/bin/bash "$self" "$@"
|
|
fi
|
|
|
|
# Steam adds its overlay and runtime libraries to every child; host tools don't want them.
|
|
unset LD_PRELOAD LD_LIBRARY_PATH
|
|
export PATH=/usr/local/bin:/usr/bin:/bin
|
|
|
|
dry_run=0
|
|
[ "${1-}" = --dry-run ] && dry_run=1
|
|
|
|
unit=frametop-framedrop-install
|
|
state=$HOME/.cache/frametop-framedrop
|
|
log=$state/install.log
|
|
mkdir -p "$state"
|
|
|
|
get_args="--yes"
|
|
[ "$dry_run" = 1 ] && get_args="--yes --clone-only --dir $state/dry-run"
|
|
|
|
# Start the install unless one is running already. RemainAfterExit keeps its result for the
|
|
# window; the next start clears it.
|
|
if [ "$(systemctl --user show -P ActiveState "$unit" 2>/dev/null)" != activating ]; then
|
|
systemctl --user stop "$unit" 2>/dev/null
|
|
systemctl --user reset-failed "$unit" 2>/dev/null
|
|
: >"$log"
|
|
systemd-run --user --unit="$unit" --description="Frametop install (FrameDrop)" \
|
|
--property=Type=oneshot --property=RemainAfterExit=yes \
|
|
--property=StandardOutput="truncate:$log" --property=StandardError=inherit \
|
|
--setenv=HOME="$HOME" --setenv=PATH="$PATH" --setenv=TERM=dumb \
|
|
--working-directory="$HOME" --quiet --no-block \
|
|
/usr/bin/bash -c 'set -o pipefail; curl -fsSL https://deejanuz.github.io/frametop/get.sh | bash -s -- '"$get_args" ||
|
|
{ echo "couldn't start the install service" >&2; exit 1; }
|
|
fi
|
|
|
|
exec /usr/bin/python3 "$here/progress.py" "$unit" "$log"
|