-
-
Save step21/d5139293e16336a48ebd60877b39be82 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/bash | |
echo "Checking the bus for any Nvidia cards.." | |
if lspci | grep NVIDIA | |
then | |
echo "Nvidia GPU detected!" | |
echo "Switching to Nvidia..." | |
if pacman -Qe | grep mesa-libgl | |
then | |
yes | pacman -S nvidia-libgl lib32-nvidia-libgl | |
fi | |
ln -sf /etc/X11/xorg.conf.nvidia /etc/X11/xorg.conf | |
else | |
echo "No Nvidia GPU detected" | |
echo "Switching to Mesa.." | |
if pacman -Qe | grep nvidia-libgl | |
then | |
yes | pacman -S mesa-libgl lib32-mesa-libgl | |
fi | |
rm /etc/X11/xorg.conf | |
fi | |
echo "Switched" | |
#sudo systemctl restart lightdm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment