Skip to content

Commit c111b07

Browse files
Typo formatting fixes, comments, remove service activations
1 parent a27a218 commit c111b07

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ installDeps() {
1414
printf "%b\n" "${CYAN}Installing headers for $kernel...${RC}"
1515
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$header"
1616
done
17-
1817
}
1918

2019
checkHardware() {
20+
# Refer https://nouveau.freedesktop.org/CodeNames.html for model code names
2121
model=$(lspci -k | grep -A 2 -E "(VGA|3D)" | grep controller | cut -d ' ' -f 7 | cut -c 1-2 )
2222
case "$model" in
2323
GM|GP|GV) return 1 ;;
2424
TU|GA|AD) return 0 ;;
25-
*) printf "%b\n" "${RED}Your hardware is not supported." && exit 1 ;;
25+
*) printf "%b\n" "${RED}Unsupported hardware." && exit 1 ;;
2626
esac
2727
}
2828

@@ -40,13 +40,18 @@ enableNvidiaModeset() {
4040
else
4141
"$ESCALATION_TOOL" sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"$/ $PARAMETER\"/" /etc/default/grub
4242
printf "%b\n" "${CYAN}Added $PARAMETER to /etc/default/grub.${RC}"
43-
4443
"$ESCALATION_TOOL" grub-mkconfig -o /boot/grub/grub.cfg
4544
fi
4645
}
4746

48-
setupHardwareAccelration() {
47+
setupHardwareAcceleration() {
48+
if ! command_exists grub-mkconfig; then
49+
printf "%b\n" "${RED}Currently hardware acceleration is only available with GRUB.${RC}"
50+
return;
51+
fi
52+
4953
modeset=$("$ESCALATION_TOOL" cat /sys/module/nvidia_drm/parameters/modeset)
54+
5055
if [ ! "$modeset" = "Y" ]; then
5156
enableNvidiaModeset
5257
fi
@@ -70,18 +75,19 @@ setupHardwareAccelration() {
7075

7176
printf "LIBVA_DRIVER_NAME=nvidia\nMOZ_DISABLE_RDD_SANDBOX=1" | "$ESCALATION_TOOL" tee -a /etc/environment > /dev/null
7277

73-
printf "%b\n" "${GREEN}Hardware Accelration setup completed successfully.${RC}"
78+
printf "%b\n" "${GREEN}Hardware Acceleration setup completed successfully.${RC}"
7479

75-
if promptUser "enable hardware accelration in mpv player"; then
80+
if promptUser "enable hardware Acceleration in mpv player"; then
7681
if [ -f "$HOME/.config/mpv/mpv.conf" ];then
7782
sed -i '/^hwdec/d' "$HOME/.config/mpv/mpv.conf"
7883
fi
7984
printf "hwdec=auto" | tee -a "$HOME/.config/mpv/mpv.conf" > /dev/null
80-
printf "%b\n" "${GREEN}MPV Hardware Accelration enabled successfully.${RC}"
85+
printf "%b\n" "${GREEN}MPV Hardware Acceleration enabled successfully.${RC}"
8186
fi
8287
}
8388

8489
installDriver() {
90+
# Refer https://wiki.archlinux.org/title/NVIDIA for open-dkms or dkms driver selection
8591
if checkHardware && promptUser "install nvidia's open source drivers"; then
8692
printf "%b\n" "${YELLOW}Installing nvidia open source driver...${RC}"
8793
installDeps
@@ -92,13 +98,9 @@ installDriver() {
9298
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm nvidia-dkms
9399
fi
94100

95-
if echo "$XDG_CURRENT_DESKTOP" | grep -q "GNOME"; then
96-
"$ESCALATION_TOOL" systemctl enable nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service
97-
fi
98-
99101
printf "%b\n" "${GREEN}Driver installed successfully.${RC}"
100-
if command_exists grub-mkconfig && promptUser "setup hardware accelration"; then
101-
setupHardwareAccelration
102+
if promptUser "setup hardware Acceleration"; then
103+
setupHardwareAcceleration
102104
fi
103105

104106
printf "%b\n" "${GREEN}Please reboot your system for the changes to take effect.${RC}"

core/tabs/system-setup/tab_data.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ script = "arch/server-setup.sh"
1616
task_list = "SI D"
1717

1818
[[data.entries]]
19-
name = "Nvidia Drivers && Hardware Accelration"
20-
description = "This script installs and configures nvidia drivers with Hardware Accelration."
19+
name = "Nvidia Drivers && Hardware Acceleration"
20+
description = "This script installs and configures nvidia drivers with Hardware Acceleration."
2121
script = "arch/nvidia-drivers.sh"
22-
task_list = "I FM RP SS"
22+
task_list = "I FM"
2323

2424
[[data.entries]]
2525
name = "Paru AUR Helper"

docs/userguide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ For more information visit: https://christitus.com/linux-security-mistakes
101101
### Arch Linux
102102

103103
- **Arch Server Setup**: This command installs a minimal arch server setup under 5 minutes.
104-
- **Nvidia Drivers && Hardware Accelration**: This script installs and configures nvidia drivers with Hardware Accelration.
104+
- **Nvidia Drivers && Hardware Acceleration**: This script installs and configures nvidia drivers with Hardware Acceleration.
105105
- **Paru AUR Helper**: Paru is your standard pacman wrapping AUR helper with lots of features and minimal interaction.
106106
To know more about AUR helpers visit: https://wiki.archlinux.org/title/AUR_helpers
107107
- **Yay AUR Helper**: Yet Another Yogurt - An AUR Helper Written in Go.

0 commit comments

Comments
 (0)