Files

35 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# SteamFrame FPV — Lanceur VR Natif (Mode Gaming SteamOS / OpenXR Direct sans fenêtre 2D)
set -euo pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
cd "$DIR"
if [ -d "$HOME/.cargo/bin" ]; then
export PATH="$HOME/.cargo/bin:$PATH"
fi
# Bibliothèques locales éventuelles (sans ':' final qui ajouterait CWD à LD_LIBRARY_PATH)
mkdir -p "$HOME/.local/lib"
if [ ! -f "$HOME/.local/lib/libxkbcommon-x11.so" ]; then
for candidate in \
"/usr/lib/aarch64-linux-gnu/libxkbcommon-x11.so.0" \
"/usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0" \
"/usr/lib/libxkbcommon-x11.so.0" \
"/usr/lib/libxkbcommon-x11.so"; do
if [ -f "$candidate" ]; then
ln -sf "$candidate" "$HOME/.local/lib/libxkbcommon-x11.so"
break
fi
done
fi
export LD_LIBRARY_PATH="$HOME/.local/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
# Compiler en Release si le binaire n'est pas encore présent
if [ ! -f "$DIR/target/release/steamframe-fpv" ]; then
echo "Compilation initiale de SteamFrame FPV en mode Release..."
cargo build --release
fi
exec "$DIR/target/release/steamframe-fpv" --vr-only "$@"