From ebfcefa5538d6e47683925c1df16ba3ea645b91c Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sat, 7 Feb 2026 00:34:13 -0500 Subject: [PATCH] Consolidate migration sed cleanup and quote heredoc paths --- install/config/hardware/nvidia.sh | 4 ++-- migrations/1770159912.sh | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/install/config/hardware/nvidia.sh b/install/config/hardware/nvidia.sh index a9b33dc0..da2ba180 100644 --- a/install/config/hardware/nvidia.sh +++ b/install/config/hardware/nvidia.sh @@ -34,7 +34,7 @@ EOF # Add NVIDIA environment variables based on GPU architecture if [ "$GPU_ARCH" = "turing_plus" ]; then # Turing+ (RTX 20xx, GTX 16xx, and newer) with GSP firmware support - cat >>$HOME/.config/hypr/envs.conf <<'EOF' + cat >>"$HOME/.config/hypr/envs.conf" <<'EOF' # NVIDIA (Turing+ with GSP firmware) env = NVD_BACKEND,direct @@ -43,7 +43,7 @@ env = __GLX_VENDOR_LIBRARY_NAME,nvidia EOF elif [ "$GPU_ARCH" = "maxwell_pascal_volta" ]; then # Maxwell/Pascal/Volta (GTX 9xx/10xx, GT 10xx, Quadro P/M/GV, MX series, Titan X/Xp/V) lack GSP firmware - cat >>$HOME/.config/hypr/envs.conf <<'EOF' + cat >>"$HOME/.config/hypr/envs.conf" <<'EOF' # NVIDIA (Maxwell/Pascal/Volta without GSP firmware) env = NVD_BACKEND,egl diff --git a/migrations/1770159912.sh b/migrations/1770159912.sh index 7003c2d8..5709cdb7 100644 --- a/migrations/1770159912.sh +++ b/migrations/1770159912.sh @@ -14,13 +14,11 @@ if echo "$NVIDIA" | grep -qE "GTX (9[0-9]{2}|10[0-9]{2})|GT 10[0-9]{2}|Quadro [P # Create backup cp "$ENVS_CONF" "$ENVS_CONF.bak.$(date +%s)" - # Remove problematic lines and old NVIDIA section header - sed -i '/^env = NVD_BACKEND,direct$/d' "$ENVS_CONF" - sed -i '/^env = LIBVA_DRIVER_NAME,nvidia$/d' "$ENVS_CONF" - sed -i '/^# NVIDIA$/d' "$ENVS_CONF" + # Remove all NVIDIA env lines and section headers (we re-add the correct ones below) + sed -i '/^env = \(NVD_BACKEND\|LIBVA_DRIVER_NAME\|__GLX_VENDOR_LIBRARY_NAME\),/d; /^# NVIDIA/d' "$ENVS_CONF" # Add correct environment variables for legacy GPUs - cat >>$ENVS_CONF <<'EOF' + cat >>"$ENVS_CONF" <<'EOF' # NVIDIA (Maxwell/Pascal/Volta without GSP firmware) env = NVD_BACKEND,egl