Skip to content

Instantly share code, notes, and snippets.

@tuxarch
Created December 2, 2017 22:40
Show Gist options
  • Save tuxarch/de1b09e44d1f54998db2d8f1e5c66fa6 to your computer and use it in GitHub Desktop.
Save tuxarch/de1b09e44d1f54998db2d8f1e5c66fa6 to your computer and use it in GitHub Desktop.
switch drivers in arch(nvidia,nouveau)
#!/bin/bash
BRANCH=-340xx # Enter a branch if needed, i.e. -340xx or -304xx
NVIDIA=nvidia${BRANCH} # If no branch entered above this would be "nvidia"
NOUVEAU=xf86-video-nouveau
# Replace -R with -Rs to if you want to remove the unneeded dependencies
if [ $(pacman -Qqs ^mesa-libgl$) ]; then
pacman -S $NVIDIA ${NVIDIA}-libgl # Add lib32-${NVIDIA}-libgl and ${NVIDIA}-lts if needed
# pacman -R $NOUVEAU
elif [ $(pacman -Qqs ^${NVIDIA}$) ]; then
pacman -S --needed $NOUVEAU mesa-libgl # Add lib32-mesa-libgl if needed
pacman -R $NVIDIA # Add ${NVIDIA}-lts if needed
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment