Skip to content

Commit

Permalink
Typo fixes, comments, remove service activations
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevithakannan2 committed Oct 10, 2024
1 parent a27a218 commit 174ae9a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
26 changes: 15 additions & 11 deletions core/tabs/system-setup/arch/nvidia-drivers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ installDeps() {
}

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

Expand All @@ -45,8 +46,14 @@ enableNvidiaModeset() {
fi
}

setupHardwareAccelration() {
setupHardwareAcceleration() {
if ! command_exists grub-mkconfig; then
printf "%b\n" "${RED}Currently hardware acceleration is only available with GRUB.${RC}"
return;
fi

modeset=$("$ESCALATION_TOOL" cat /sys/module/nvidia_drm/parameters/modeset)

if [ ! "$modeset" = "Y" ]; then
enableNvidiaModeset
fi
Expand All @@ -70,18 +77,19 @@ setupHardwareAccelration() {

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

printf "%b\n" "${GREEN}Hardware Accelration setup completed successfully.${RC}"
printf "%b\n" "${GREEN}Hardware Acceleration setup completed successfully.${RC}"

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

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

if echo "$XDG_CURRENT_DESKTOP" | grep -q "GNOME"; then
"$ESCALATION_TOOL" systemctl enable nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service
fi

printf "%b\n" "${GREEN}Driver installed successfully.${RC}"
if command_exists grub-mkconfig && promptUser "setup hardware accelration"; then
setupHardwareAccelration
if promptUser "setup hardware Acceleration"; then
setupHardwareAcceleration
fi

printf "%b\n" "${GREEN}Please reboot your system for the changes to take effect.${RC}"
Expand Down
6 changes: 3 additions & 3 deletions core/tabs/system-setup/tab_data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ script = "arch/server-setup.sh"
task_list = "SI D"

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

[[data.entries]]
name = "Paru AUR Helper"
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ For more information visit: https://christitus.com/linux-security-mistakes
### Arch Linux

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

0 comments on commit 174ae9a

Please sign in to comment.