#!/usr/bin/env bash # One-command install for Steam Deck (Desktop Mode) and other Linux PCs: # curl -fsSL https://pushplay.gg/install | bash # Downloads the latest AppImage to ~/Applications, adds it to Steam with its artwork, and # restarts Steam if it was open. Safe to run again: it updates the AppImage in place. # These values must match packages/shared/src/brand.json (tests/install-script.test.ts checks). set -euo pipefail NAME="PushPlay" SLUG="pushplay" DOMAIN="pushplay.gg" # The site resolves the newest release, so this works whether the releases repo is public or not. DOWNLOAD_URL="${PUSHPLAY_DOWNLOAD_URL:-https://$DOMAIN/download/latest}" DEST_DIR="$HOME/Applications" DEST="$DEST_DIR/$NAME.AppImage" ARCH="$(uname -m)" say() { printf '\033[1m%s\033[0m\n' "$*"; } fail() { printf '\033[31m%s\033[0m\n' "$*" >&2; exit 1; } [ "$(uname -s)" = "Linux" ] || fail "$NAME's installer is for Steam Deck and Linux. On other systems, see https://$DOMAIN/download" command -v curl >/dev/null || fail "curl is needed to download $NAME." say "Downloading the latest $NAME for $ARCH…" mkdir -p "$DEST_DIR" tmp="$(mktemp "$DEST_DIR/.$SLUG-XXXXXX")" trap 'rm -f "$tmp"' EXIT curl -fL --progress-bar -o "$tmp" "$DOWNLOAD_URL?arch=$ARCH" || fail "Download failed. Check your connection, or get it from https://$DOMAIN/download" chmod +x "$tmp" mv -f "$tmp" "$DEST" trap - EXIT # Steam rewrites its shortcut list when it exits, so it has to be closed while we add ours. steam_was_running=false if pgrep -x steam >/dev/null 2>&1; then steam_was_running=true say "Closing Steam for a moment to add $NAME…" steam -shutdown >/dev/null 2>&1 || true for _ in $(seq 1 60); do pgrep -x steam >/dev/null 2>&1 || break sleep 0.5 done pgrep -x steam >/dev/null 2>&1 && fail "Steam didn't close. Quit it yourself, then run this again." fi say "Adding $NAME to Steam…" APPIMAGE="$DEST" "$DEST" --register if $steam_was_running; then (setsid steam >/dev/null 2>&1 &) || true fi echo say "Done! $NAME is in your Steam library." echo "On a Steam Deck: tap \"Return to Gaming Mode\" and find $NAME under Non-Steam."