remove defensive code

This commit is contained in:
Zhephod
2025-06-30 23:56:33 -07:00
committed by Kn0ax
parent d6a44c24a7
commit e8c9a5ad49

View File

@ -15,12 +15,6 @@ if [ -z "$gpu_info" ]; then
exit 0 exit 0
fi fi
# --- Colors for better readability ---
C_RESET='\033[0m'
C_RED='\033[0;31m'
C_YELLOW='\033[0;33m'
C_BOLD='\033[1m'
# --- Driver Selection --- # --- Driver Selection ---
# Turing (16xx, 20xx), Ampere (30xx), Ada (40xx), and newer recommend the open-source kernel modules # Turing (16xx, 20xx), Ampere (30xx), Ada (40xx), and newer recommend the open-source kernel modules
if echo "$gpu_info" | grep -q -E "RTX [2-9][0-9]|GTX 16"; then if echo "$gpu_info" | grep -q -E "RTX [2-9][0-9]|GTX 16"; then
@ -56,10 +50,7 @@ PACKAGES_TO_INSTALL=(
"qt6-wayland" "qt6-wayland"
) )
if ! yay -Syu --needed --noconfirm "${PACKAGES_TO_INSTALL[@]}"; then yay -Syu --needed --noconfirm "${PACKAGES_TO_INSTALL[@]}"
echo -e "${C_RED}${C_BOLD}[ERROR]${C_RESET} Failed to install NVIDIA packages. Please check the output for errors." >&2
exit 1
fi
# Configure modprobe for early KMS # Configure modprobe for early KMS
echo "options nvidia_drm modeset=1" | sudo tee /etc/modprobe.d/nvidia.conf >/dev/null echo "options nvidia_drm modeset=1" | sudo tee /etc/modprobe.d/nvidia.conf >/dev/null
@ -80,10 +71,7 @@ sudo sed -i -E "s/^(MODULES=\\()/\\1${NVIDIA_MODULES} /" "$MKINITCPIO_CONF"
# Clean up potential double spaces # Clean up potential double spaces
sudo sed -i -E 's/ +/ /g' "$MKINITCPIO_CONF" sudo sed -i -E 's/ +/ /g' "$MKINITCPIO_CONF"
if ! sudo mkinitcpio -P; then sudo mkinitcpio -P
echo -e "${C_RED}${C_BOLD}[ERROR]${C_RESET} Failed to rebuild initramfs with 'mkinitcpio -P'. Please check the output for errors." >&2
exit 1
fi
# Add NVIDIA environment variables to hyprland.conf # Add NVIDIA environment variables to hyprland.conf
HYPRLAND_CONF="$HOME/.config/hypr/hyprland.conf" HYPRLAND_CONF="$HOME/.config/hypr/hyprland.conf"