#!/usr/bin/env bash # Install Sunshine, Moonlight, and GPU-specific hardware-encode dependencies. # Default to source build (canonical AUR package). Override with SUNSHINE_PKG=sunshine-bin # in the environment for the precompiled build (much faster install). : "${SUNSHINE_PKG:=sunshine}" install_sunshine() { yay_install "$SUNSHINE_PKG" } install_moonlight() { # moonlight-qt is in the AUR (also a -bin variant). yay handles both. yay_install moonlight-qt } install_gpu_encoder_packages() { case "$GPU_VENDOR" in nvidia) # NVENC works through the proprietary driver. libva-nvidia-driver lets some # apps use VAAPI on NVIDIA; not strictly required for Sunshine NVENC but useful. yay_install nvidia-utils libva-nvidia-driver ;; amd) # VAAPI (mesa) + Vulkan for AMD hardware encode paths. yay_install libva-mesa-driver mesa-vdpau vulkan-radeon ;; intel) yay_install intel-media-driver vulkan-intel ;; *) info "Unknown GPU vendor; skipping vendor-specific encoder packages." ;; esac }