printf"%b\n""${YELLOW}Building the drivers may take upto 5 minutes. Please don't kill the script!\n If the build failed try running the script again, select \"Remove Nvidia Drivers\" and reboot the system, then try installing drivers again.${RC}"
printf"%b\n""${GREEN}Installed driver version $(modinfo -F version nvidia)${RC}"
break
fi
printf"%b\n""${YELLOW}Waiting for driver to be built..."
sleep 1m
done
printf"%b\n""${GREEN}Now you can reboot the system.${RC}"
}
# NOTE: A confirmation option to proceed or not
userConfirmation(){
printf"%b""${YELLOW}Do you want to continue? (Y/N): ${RC}"
read -r choice
case"$choice" in
y | Y)
checkRepo
installDriver
return
;;
n | N)
printf"%b\n""${RED} Exiting the Script ${RC}"
return
;;
*)
printf"%b\n""${RED} Invalid Option! ${RC}"
userConfirmation
;;
esac
}
printf"%b\n""${YELLOW}Warning! This script will enable Nvidia non-free repository and only install drivers for GPUs from 2014 or later. It works on fedora 34 and above.\n It is recommended remove this driver while updating your kernel packages to newer version.${RC}"