linuxbox/update/arch/gaming.sh

147 lines
4.0 KiB
Bash

#!/bin/bash
# Arch Linux Gaming Module
# Handles gaming, VR, and entertainment software
arch_install_gaming_base() {
if ! role_enabled "GAME"; then
return 0
fi
log SECTION "Installing gaming base packages"
local section_start=$(date +%s)
if confirm "Install gaming base (Wine, Steam, etc.)?"; then
local gaming_packages=(
wine wine-mono wine-gecko qt5-tools steam winetricks
onnxruntime mangohud lib32-mangohud gamemode
)
install_packages "${gaming_packages[@]}"
# Gaming tools from AUR
local gaming_aur=(
protonup-qt protontricks lug-helper openmpi jstest-gtk-git
)
install_aur_packages "${gaming_aur[@]}"
log SUCCESS "Gaming base installed $(show_timer $section_start)"
fi
}
arch_install_opentrack() {
if ! role_enabled "GAME"; then
return 0
fi
log SECTION "Installing OpenTrack head tracking"
local section_start=$(date +%s)
if confirm "Build and install OpenTrack?"; then
if [ ! -d ~/Games/opentrack ]; then
mkdir -p ~/Games
cd ~/Games
(
git clone https://github.com/opentrack/opentrack
cd opentrack/
mkdir build
cd build
cmake ..
ccmake .
make
make install
) 2>&1 | tee -a "$LOG_FILE" &
spinner $! "Building OpenTrack (this will take a while)..."
wait
# Create desktop entry
cat > /tmp/opentrack.desktop << EOF
[Desktop Entry]
Version=3.1.0
Type=Application
Name=Opentrack
Exec=$HOME/Games/opentrack/build/install/bin/opentrack -platform xcb
Icon=$HOME/Games/opentrack/contrib/cute-octopus-vector-material_15-1831.jpg
Terminal=false
StartupNotify=true
EOF
sudo mv /tmp/opentrack.desktop /usr/share/applications/opentrack.desktop
sudo update-desktop-database /usr/share/applications
fi
log SUCCESS "OpenTrack installed $(show_timer $section_start)"
fi
}
arch_install_simonbox_gaming() {
if [ "${SYSTEM_INFO[HOSTNAME]}" != "SIMONBOX" ]; then
return 0
fi
log SECTION "Installing SIMONBOX-specific gaming tools"
local section_start=$(date +%s)
if confirm "Install SIMONBOX gaming packages?"; then
# SIMONBOX specific packages
local simonbox_packages=(
fluidsynth gamemode gvfs libayatana-appindicator innoextract
lib32-gamemode lib32-vkd3d python-pefile python-protobuf
vulkan-icd-loader vkd3d lib32-vulkan-icd-loader vulkan-tools
xorg-xgamma umu-launcher lutris
)
install_packages "${simonbox_packages[@]}"
# Sober for Roblox
install_flatpak_apps org.vinegarhq.Sober
log SUCCESS "SIMONBOX gaming setup completed $(show_timer $section_start)"
fi
}
arch_install_vr() {
if ! role_enabled "VR"; then
return 0
fi
log SECTION "Installing VR support"
local section_start=$(date +%s)
if confirm "Install VR tools (Monado, overlays)?"; then
# VR development packages
local vr_packages=(
cli11 glib2-devel nlohmann-json glew
)
install_packages "${vr_packages[@]}"
# VR tools from AUR
local vr_aur=(
monado-vulkan-layers-git wlx-overlay-s-git xrgears envision-xr-git
)
install_aur_packages "${vr_aur[@]}"
log SUCCESS "VR support installed $(show_timer $section_start)"
fi
}
# Main function
arch_setup_gaming() {
if ! role_enabled "GAME"; then
log INFO "Gaming role not enabled - skipping gaming setup"
return 0
fi
arch_install_gaming_base
arch_install_opentrack
arch_install_simonbox_gaming
arch_install_vr
}
if [ -z "$ARCH_GAMING_LOADED" ]; then
ARCH_GAMING_LOADED=true
fi