@@ -6,7 +6,7 @@ LIBVA_DIR="$HOME/linuxtoolbox/libva"
6
6
7
7
installDeps () {
8
8
" $ESCALATION_TOOL " " $PACKAGER " -S --needed --noconfirm base-devel dkms ninja meson
9
-
9
+
10
10
installed_kernels=$( " $PACKAGER " -Q | grep -E ' ^linux(| |-rt|-rt-lts|-hardened|-zen|-lts)[^-headers]' | cut -d ' ' -f 1)
11
11
12
12
for kernel in $installed_kernels ; do
@@ -20,8 +20,8 @@ checkNvidiaHardware() {
20
20
# Refer https://nouveau.freedesktop.org/CodeNames.html for model code names
21
21
model=$( lspci -k | grep -A 2 -E " (VGA|3D)" | grep NVIDIA | sed ' s/.*Corporation //;s/ .*//' | cut -c 1-2)
22
22
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 ;;
25
25
* ) printf " %b\n" " ${RED} Unsupported hardware." && exit 1 ;;
26
26
esac
27
27
}
@@ -52,7 +52,7 @@ setKernelParam() {
52
52
setupHardwareAcceleration () {
53
53
if ! command_exists grub-mkconfig; then
54
54
printf " %b\n" " ${RED} Currently hardware acceleration is only available with GRUB.${RC} "
55
- return ;
55
+ return
56
56
fi
57
57
58
58
" $ESCALATION_TOOL " " $PACKAGER " -S --needed --noconfirm libva-nvidia-driver
@@ -75,9 +75,10 @@ setupHardwareAcceleration() {
75
75
printf " LIBVA_DRIVER_NAME=nvidia\nMOZ_DISABLE_RDD_SANDBOX=1" | " $ESCALATION_TOOL " tee -a /etc/environment > /dev/null
76
76
77
77
printf " %b\n" " ${GREEN} Hardware Acceleration setup completed successfully.${RC} "
78
-
78
+
79
79
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
81
82
sed -i ' /^hwdec/d' " $HOME /.config/mpv/mpv.conf"
82
83
fi
83
84
printf " hwdec=auto" | tee -a " $HOME /.config/mpv/mpv.conf" > /dev/null
@@ -115,4 +116,4 @@ installDriver() {
115
116
116
117
checkEnv
117
118
checkEscalationTool
118
- installDriver
119
+ installDriver
0 commit comments