Last active
June 30, 2019 19:32
-
-
Save ceyusa/a06ce679a9876f2ccad8 to your computer and use it in GitHub Desktop.
Switching between nouveau and the nVIDIA proprietary OpenGL driver in (Debian) GNU/Linux http://blog.andresgomez.org/2014/11/19/switching-between-nouveau-and-the-nvidia-proprietary-opengl-driver-in-debian-gnulinux/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ALTERNATIVE="" | |
| function check_root { | |
| ID=`id -u` | |
| if [ ${ID} -ne 0 ]; then | |
| echo "You have to be root to run this script" | |
| exit 0 | |
| fi | |
| } | |
| function syntax { | |
| echo "Syntax: $0 [nvidia|nouveau]" | |
| exit 0 | |
| } | |
| check_root | |
| if [ -z "${1}" ]; then | |
| syntax | |
| elif [ "x${1}" == "xnouveau" ]; then | |
| ALTERNATIVE="/usr/lib/mesa-diverted" | |
| elif [ "x${1}" == "xnvidia" ]; then | |
| ALTERNATIVE="/usr/lib/nvidia" | |
| else | |
| syntax | |
| fi | |
| update-alternatives --set glx "${ALTERNATIVE}" | |
| update-initramfs -u | |
| echo "" | |
| echo "${1} successfully set. Reboot your system to apply the changes ..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment