Initial commit

This commit is contained in:
Xavier Vintimilla 2021-06-01 01:20:04 +00:00
parent a8cbd4b9d0
commit 1ce91afa2b

58
install-nvidia.sh Normal file
View File

@ -0,0 +1,58 @@
#!/bin/bash
RED='\033[0;31m'
RESET='\033[0m'
KERNEL="$(uname -r)"
function rootCheck(){
if [ "$USER" != "root" ]; then
echo "$RED You need to be root to run this script... $RESET"
exit 1
fi
}
function xorgInstall(){
pacman -S xorg xorg-server
if [ "$?" != "0" ]; then
echo "$RED An error occurred while installing Xorg $RESET"
exit 1
fi
}
function nvidiaInstall(){
pacman -S nvidia nvidia-utils nvidia-settings opencl-nvidia
if [ "$?" != "0" ]; then
echo "$RED An error occurred while installing the NVIDIA drivers on kernel $KERNEL $RESET"
exit 1
fi
cat /usr/lib/modprobe.d/nvidia-lts.conf
}
function nvidiaInstallLTS(){
pacman -S nvidia-lts nvidia-utils nvidia-settings opencl-nvidia
if [ "$?" != "0" ]; then
echo "$RED An error occurred while installing the NVIDIA LTS drivers on kernel $KERNEL LTS $RESET"
exit 1
fi
cat /usr/lib/modprobe.d/nvidia-lts.conf
}
rootCheck
xorgInstall
case $1 in
--lts)
nvidiaInstallLTS
;;
*)
nvidiaInstall
;;
esac
exit 0