#!/usr/bin/env bash # Install Sunshine, Moonlight, and GPU-specific hardware-encode dependencies. # Default to the precompiled AUR build for a fast install (~seconds instead of # the ~10 minute source compile). Override with SUNSHINE_PKG=sunshine to build # from source. : "${SUNSHINE_PKG:=sunshine-bin}" : "${MOONLIGHT_PKG:=moonlight-qt}" install_sunshine() { # Ensure runtime deps useful for capture/diagnostics across vendors. yay_install pipewire-pulse vulkan-tools libva-utils jq yay_install "$SUNSHINE_PKG" } install_moonlight() { yay_install "$MOONLIGHT_PKG" } 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 }