Files
nocode 4f4afec6b2 feat(releng): add fws-proton-ge script for proton-ge installation
Add a user-friendly bash script that automates downloading and installing
Proton-GE (GloriousEggroll) for Steam. The script fetches the latest release
from GitHub, verifies integrity with SHA512 checksums, and installs it to the
user's Steam compatibility tools directory. Includes error handling and user
guidance for Steam configuration.
2026-07-04 12:56:44 +02:00

47 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# FWS — installe/actualise Proton-GE (GloriousEggroll) pour Steam :
# meilleure compatibilité des jeux Windows que le Proton officiel.
# S'exécute en UTILISATEUR (installe dans ~/.steam/root/compatibilitytools.d).
set -u
say() { printf '\n\033[1;34m==> %s\033[0m\n' "$*"; }
fail() { printf '\033[1;31m ✗ %s\033[0m\n' "$*"; read -rp "Entrée pour fermer. " _; exit 1; }
[ "$(id -u)" -eq 0 ] && fail "à lancer en utilisateur normal (pas root) : l'outil s'installe dans ton Steam."
API="https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest"
DEST="$HOME/.steam/root/compatibilitytools.d"
say "Recherche de la dernière version de Proton-GE…"
JSON="$(curl -fsSL "$API")" || fail "GitHub inaccessible (réseau ?)"
URL="$(printf '%s' "$JSON" | grep -o '"browser_download_url": *"[^"]*\.tar\.gz"' | cut -d'"' -f4 | head -1)"
SUM_URL="$(printf '%s' "$JSON" | grep -o '"browser_download_url": *"[^"]*\.sha512sum"' | cut -d'"' -f4 | head -1)"
[ -n "$URL" ] || fail "archive introuvable dans la release GitHub"
NAME="$(basename "$URL" .tar.gz)"
if [ -d "$DEST/$NAME" ]; then
say "$NAME est déjà installé ✔"
read -rp "Entrée pour fermer. " _; exit 0
fi
TMP="$(mktemp -d)"
trap 'rm -rf "$TMP"' EXIT
say "Téléchargement de $NAME (~450 Mo)…"
curl -fL --progress-bar -o "$TMP/$NAME.tar.gz" "$URL" || fail "téléchargement échoué"
if [ -n "$SUM_URL" ]; then
say "Vérification de l'intégrité (sha512)…"
curl -fsSL -o "$TMP/sum" "$SUM_URL" \
&& (cd "$TMP" && sed "s|[^ ]*\.tar\.gz|$NAME.tar.gz|" sum | sha512sum -c -) \
|| fail "somme de contrôle invalide — archive corrompue ?"
fi
say "Installation dans $DEST"
mkdir -p "$DEST"
tar -xzf "$TMP/$NAME.tar.gz" -C "$DEST" || fail "extraction échouée"
say "$NAME installé ✔"
echo " Dans Steam : Paramètres → Compatibilité → activer, puis choisir"
echo " « $NAME » (ou par jeu : Propriétés → Compatibilité)."
echo " Redémarre Steam pour qu'il apparaisse."
read -rp "Entrée pour fermer. " _