Use consistent bash5 style for conditionals and quoting
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
NVIDIA="$(lspci | grep -i 'nvidia')"
|
||||
|
||||
if [ -n "$NVIDIA" ]; then
|
||||
if [[ -n $NVIDIA ]]; then
|
||||
# Check which kernel is installed and set appropriate headers package
|
||||
KERNEL_HEADERS="$(pacman -Qqs '^linux(-zen|-lts|-hardened)?$' | head -1)-headers"
|
||||
|
||||
@@ -14,7 +14,7 @@ if [ -n "$NVIDIA" ]; then
|
||||
GPU_ARCH="maxwell_pascal_volta"
|
||||
fi
|
||||
# Bail if no supported GPU
|
||||
if [ -z "${PACKAGES+x}" ]; then
|
||||
if [[ -z ${PACKAGES+x} ]]; then
|
||||
echo "No compatible driver for your NVIDIA GPU. See: https://wiki.archlinux.org/title/NVIDIA"
|
||||
exit 0
|
||||
fi
|
||||
@@ -32,7 +32,7 @@ MODULES+=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)
|
||||
EOF
|
||||
|
||||
# Add NVIDIA environment variables based on GPU architecture
|
||||
if [ "$GPU_ARCH" = "turing_plus" ]; then
|
||||
if [[ $GPU_ARCH = "turing_plus" ]]; then
|
||||
# Turing+ (RTX 20xx, GTX 16xx, and newer) with GSP firmware support
|
||||
cat >>"$HOME/.config/hypr/envs.conf" <<'EOF'
|
||||
|
||||
@@ -41,7 +41,7 @@ env = NVD_BACKEND,direct
|
||||
env = LIBVA_DRIVER_NAME,nvidia
|
||||
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
|
||||
EOF
|
||||
elif [ "$GPU_ARCH" = "maxwell_pascal_volta" ]; then
|
||||
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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user