Skip to content

Commit 9353fa3

Browse files
chore: formatting
1 parent bfc31b6 commit 9353fa3

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

core/tabs/system-setup/arch/nvidia-drivers.sh

+8-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LIBVA_DIR="$HOME/linuxtoolbox/libva"
66

77
installDeps() {
88
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm base-devel dkms ninja meson
9-
9+
1010
installed_kernels=$("$PACKAGER" -Q | grep -E '^linux(| |-rt|-rt-lts|-hardened|-zen|-lts)[^-headers]' | cut -d ' ' -f 1)
1111

1212
for kernel in $installed_kernels; do
@@ -20,8 +20,8 @@ checkNvidiaHardware() {
2020
# Refer https://nouveau.freedesktop.org/CodeNames.html for model code names
2121
model=$(lspci -k | grep -A 2 -E "(VGA|3D)" | grep NVIDIA | sed 's/.*Corporation //;s/ .*//' | cut -c 1-2)
2222
case "$model" in
23-
GM|GP|GV) return 1 ;;
24-
TU|GA|AD) return 0 ;;
23+
GM | GP | GV) return 1 ;;
24+
TU | GA | AD) return 0 ;;
2525
*) printf "%b\n" "${RED}Unsupported hardware." && exit 1 ;;
2626
esac
2727
}
@@ -52,7 +52,7 @@ setKernelParam() {
5252
setupHardwareAcceleration() {
5353
if ! command_exists grub-mkconfig; then
5454
printf "%b\n" "${RED}Currently hardware acceleration is only available with GRUB.${RC}"
55-
return;
55+
return
5656
fi
5757

5858
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libva-nvidia-driver
@@ -75,9 +75,10 @@ setupHardwareAcceleration() {
7575
printf "LIBVA_DRIVER_NAME=nvidia\nMOZ_DISABLE_RDD_SANDBOX=1" | "$ESCALATION_TOOL" tee -a /etc/environment > /dev/null
7676

7777
printf "%b\n" "${GREEN}Hardware Acceleration setup completed successfully.${RC}"
78-
78+
7979
if promptUser "enable Hardware Acceleration in MPV player"; then
80-
if [ -f "$HOME/.config/mpv/mpv.conf" ];then
80+
mkdir -p "$HOME/.config/mpv"
81+
if [ -f "$HOME/.config/mpv/mpv.conf" ]; then
8182
sed -i '/^hwdec/d' "$HOME/.config/mpv/mpv.conf"
8283
fi
8384
printf "hwdec=auto" | tee -a "$HOME/.config/mpv/mpv.conf" > /dev/null
@@ -115,4 +116,4 @@ installDriver() {
115116

116117
checkEnv
117118
checkEscalationTool
118-
installDriver
119+
installDriver

0 commit comments

Comments
 (0)