mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-25 06:24:26 +00:00
Typo formatting fixes, comments, remove service activations
This commit is contained in:
parent
a27a21835e
commit
c111b07e13
|
@ -14,15 +14,15 @@ installDeps() {
|
||||||
printf "%b\n" "${CYAN}Installing headers for $kernel...${RC}"
|
printf "%b\n" "${CYAN}Installing headers for $kernel...${RC}"
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$header"
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm "$header"
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkHardware() {
|
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 )
|
model=$(lspci -k | grep -A 2 -E "(VGA|3D)" | grep controller | cut -d ' ' -f 7 | cut -c 1-2 )
|
||||||
case "$model" in
|
case "$model" in
|
||||||
GM|GP|GV) return 1 ;;
|
GM|GP|GV) return 1 ;;
|
||||||
TU|GA|AD) return 0 ;;
|
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
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,13 +40,18 @@ enableNvidiaModeset() {
|
||||||
else
|
else
|
||||||
"$ESCALATION_TOOL" sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"$/ $PARAMETER\"/" /etc/default/grub
|
"$ESCALATION_TOOL" sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"$/ $PARAMETER\"/" /etc/default/grub
|
||||||
printf "%b\n" "${CYAN}Added $PARAMETER to /etc/default/grub.${RC}"
|
printf "%b\n" "${CYAN}Added $PARAMETER to /etc/default/grub.${RC}"
|
||||||
|
|
||||||
"$ESCALATION_TOOL" grub-mkconfig -o /boot/grub/grub.cfg
|
"$ESCALATION_TOOL" grub-mkconfig -o /boot/grub/grub.cfg
|
||||||
fi
|
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)
|
modeset=$("$ESCALATION_TOOL" cat /sys/module/nvidia_drm/parameters/modeset)
|
||||||
|
|
||||||
if [ ! "$modeset" = "Y" ]; then
|
if [ ! "$modeset" = "Y" ]; then
|
||||||
enableNvidiaModeset
|
enableNvidiaModeset
|
||||||
fi
|
fi
|
||||||
|
@ -70,18 +75,19 @@ setupHardwareAccelration() {
|
||||||
|
|
||||||
printf "LIBVA_DRIVER_NAME=nvidia\nMOZ_DISABLE_RDD_SANDBOX=1" | "$ESCALATION_TOOL" tee -a /etc/environment > /dev/null
|
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
|
if [ -f "$HOME/.config/mpv/mpv.conf" ];then
|
||||||
sed -i '/^hwdec/d' "$HOME/.config/mpv/mpv.conf"
|
sed -i '/^hwdec/d' "$HOME/.config/mpv/mpv.conf"
|
||||||
fi
|
fi
|
||||||
printf "hwdec=auto" | tee -a "$HOME/.config/mpv/mpv.conf" > /dev/null
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
installDriver() {
|
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
|
if checkHardware && promptUser "install nvidia's open source drivers"; then
|
||||||
printf "%b\n" "${YELLOW}Installing nvidia open source driver...${RC}"
|
printf "%b\n" "${YELLOW}Installing nvidia open source driver...${RC}"
|
||||||
installDeps
|
installDeps
|
||||||
|
@ -92,13 +98,9 @@ installDriver() {
|
||||||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm nvidia-dkms
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm nvidia-dkms
|
||||||
fi
|
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}"
|
printf "%b\n" "${GREEN}Driver installed successfully.${RC}"
|
||||||
if command_exists grub-mkconfig && promptUser "setup hardware accelration"; then
|
if promptUser "setup hardware Acceleration"; then
|
||||||
setupHardwareAccelration
|
setupHardwareAcceleration
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%b\n" "${GREEN}Please reboot your system for the changes to take effect.${RC}"
|
printf "%b\n" "${GREEN}Please reboot your system for the changes to take effect.${RC}"
|
||||||
|
|
|
@ -16,10 +16,10 @@ script = "arch/server-setup.sh"
|
||||||
task_list = "SI D"
|
task_list = "SI D"
|
||||||
|
|
||||||
[[data.entries]]
|
[[data.entries]]
|
||||||
name = "Nvidia Drivers && Hardware Accelration"
|
name = "Nvidia Drivers && Hardware Acceleration"
|
||||||
description = "This script installs and configures nvidia drivers with Hardware Accelration."
|
description = "This script installs and configures nvidia drivers with Hardware Acceleration."
|
||||||
script = "arch/nvidia-drivers.sh"
|
script = "arch/nvidia-drivers.sh"
|
||||||
task_list = "I FM RP SS"
|
task_list = "I FM"
|
||||||
|
|
||||||
[[data.entries]]
|
[[data.entries]]
|
||||||
name = "Paru AUR Helper"
|
name = "Paru AUR Helper"
|
||||||
|
|
|
@ -101,7 +101,7 @@ For more information visit: https://christitus.com/linux-security-mistakes
|
||||||
### Arch Linux
|
### Arch Linux
|
||||||
|
|
||||||
- **Arch Server Setup**: This command installs a minimal arch server setup under 5 minutes.
|
- **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.
|
- **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
|
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.
|
- **Yay AUR Helper**: Yet Another Yogurt - An AUR Helper Written in Go.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user