From 06121343e78ec867c1bc1ac39352b3ce9edab863 Mon Sep 17 00:00:00 2001 From: nocode Date: Sat, 4 Jul 2026 03:30:28 +0200 Subject: [PATCH] feat(releng): add fws-vr-setup script for VR driver installation Add interactive shell script for installing VR drivers and runtimes based on headset type. Supports HTC Vive/Valve Index (native SteamVR), Meta Quest/Pico (ALVR streaming), and Monado (OpenXR runtime). Script automatically detects GPU and installs appropriate 32-bit Vulkan libraries required by SteamVR. Includes multilib configuration and user guidance for each VR setup path. --- .../airootfs/usr/local/bin/fws-vr-setup | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100755 configs/releng/airootfs/usr/local/bin/fws-vr-setup diff --git a/configs/releng/airootfs/usr/local/bin/fws-vr-setup b/configs/releng/airootfs/usr/local/bin/fws-vr-setup new file mode 100755 index 0000000..65e4fb1 --- /dev/null +++ b/configs/releng/airootfs/usr/local/bin/fws-vr-setup @@ -0,0 +1,95 @@ +#!/bin/bash +# ============================================================================ +# FWS — installation des drivers/runtimes VR selon le casque. +# +# À lancer depuis un terminal (Super+Shift+V sous i3, ou l'entrée +# « Installation VR (FWS) » du menu d'applications). Réservé aux sessions +# X11 (i3) : SteamVR ne fonctionne PAS sous Wayland/Hyprland. +# +# Réalité du support Linux (résumé honnête) : +# • HTC Vive / Vive Pro / Valve Index (stations lighthouse) → NATIF via +# SteamVR. C'est le chemin le plus fiable. +# • Meta/Oculus Quest 1-3, Pico → PAS de support officiel ; streaming +# Wi-Fi via ALVR (+ SteamVR). ALVR n'est pas dans les dépôts Arch : +# le script installe la base et donne la marche à suivre. +# • Oculus Rift CV1/S (filaire) → pas de support utilisable. +# • Monado : runtime OpenXR libre (déjà proposé par fws-setup-hardware), +# utile pour les applis OpenXR natives sans SteamVR. +# ============================================================================ +set -u +say() { printf '\n\033[1;34m==> %s\033[0m\n' "$*"; } +warn() { printf '\033[1;33m ⚠ %s\033[0m\n' "$*"; } + +if [ "$(id -u)" -ne 0 ]; then + exec sudo "$0" "$@" +fi + +# lib32 Vulkan selon le GPU (indispensable à SteamVR, qui est 32/64 bits). +GPU="$(lspci 2>/dev/null | grep -iE 'VGA compatible controller|3D controller|Display controller')" +LIB32="lib32-mesa" +case "$GPU" in + *NVIDIA*|*GeForce*) LIB32="$LIB32 lib32-nvidia-utils" ;; + *AMD*|*ATI*|*Radeon*) LIB32="$LIB32 lib32-vulkan-radeon" ;; + *Intel*) LIB32="$LIB32 lib32-vulkan-intel" ;; +esac + +install_pkgs() { + # multilib requis pour Steam/lib32. + grep -qE '^\[multilib\]' /etc/pacman.conf \ + || printf '\n[multilib]\nInclude = /etc/pacman.d/mirrorlist\n' >> /etc/pacman.conf + pacman -Sy --noconfirm || { warn "synchro pacman échouée (réseau ?)"; return 1; } + local valid="" p + for p in "$@"; do + pacman -Si "$p" >/dev/null 2>&1 && valid="$valid $p" || warn "paquet inconnu ignoré : $p" + done + # shellcheck disable=SC2086 + pacman -S --noconfirm --needed $valid +} + +steamvr_base() { + say "Installation de la base SteamVR (Steam + Vulkan 32 bits : $LIB32)…" + # shellcheck disable=SC2086 + install_pkgs steam $LIB32 || return 1 + say "Base installée. Étapes suivantes :" + echo " 1. Lance Steam, connecte-toi, puis installe « SteamVR » (Bibliothèque → Outils)." + echo " 2. Branche le casque et les stations, puis lance SteamVR." + echo " 3. Premier lancement : SteamVR peut demander à ajuster les règles udev — accepte." +} + +case "${1:-menu}" in + menu) + cat <<'MENU' + + ╔══════════════════════════════════════════════════════════╗ + ║ FWS — Installation VR (session X11 requise) ║ + ╠══════════════════════════════════════════════════════════╣ + ║ 1) HTC Vive / Vive Pro / Valve Index (natif, SteamVR) ║ + ║ 2) Meta Quest / Pico (streaming ALVR) ║ + ║ 3) Monado (runtime OpenXR libre, sans SteamVR) ║ + ║ q) Quitter ║ + ╚══════════════════════════════════════════════════════════╝ +MENU + read -rp " Choix : " choice + exec "$0" "$choice" + ;; + 1|vive|index) + steamvr_base || exit 1 + ;; + 2|quest|pico) + steamvr_base || exit 1 + say "Streaming Quest/Pico : il faut AUSSI ALVR (pas dans les dépôts Arch) :" + echo " 1. Télécharge le .tar.gz « ALVR Launcher » : https://github.com/alvr-org/ALVR/releases" + echo " 2. Sur le casque, installe le client ALVR (App Lab / SideQuest)." + echo " 3. Lance ALVR sur le PC (même Wi-Fi 5 GHz que le casque) — il pilote SteamVR." + ;; + 3|monado) + say "Installation de Monado (OpenXR) + outils…" + install_pkgs monado || exit 1 + say "Monado installé. Les applis OpenXR le trouvent via /usr/share/openxr/." + ;; + q|Q) exit 0 ;; + *) warn "choix inconnu : ${1}"; exec "$0" menu ;; +esac + +echo +read -rp "Terminé — appuie sur Entrée pour fermer. " _