Skip to content

Instantly share code, notes, and snippets.

@step21
Forked from NeoTheFox/switchgpu.sh
Created August 5, 2016 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save step21/fbd6d188ab2d1cb259cfe11fcae148bd to your computer and use it in GitHub Desktop.
Save step21/fbd6d188ab2d1cb259cfe11fcae148bd to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
xconfig="/etc/X11/xorg.conf"
if [ -e "$xconfig" ]
then
echo "Nvidia xconfig detected"
echo "Switching to mesa..."
sudo pacman -S lib32-mesa-libgl mesa-libgl
sudo rm $xconfig
else
echo "No Nvidia xconfig detected"
echo "Switching to Nvidia.."
sudo nvidia-xconfig
sudo pacman -S lib32-nvidia-libgl nvidia-libgl
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