portablejim

nvidia-switch

Mar 12th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1.  
  2. #!/bin/bash
  3.  
  4. depend() {
  5. need localmount
  6. before xdm
  7. }
  8.  
  9. if [[ $(uname -r) == *-nvidia ]] ; then
  10. modprobe -q nvidia
  11. if [[ $(eselect opengl show) != nvidia ]] ; then
  12. eselect opengl set nvidia &>/dev/null
  13. fi
  14. cat > /etc/X11/xorg.conf.d/01-nvidia.conf << EOF
  15. Section "Device"
  16. Identifier "Device0"
  17. Driver "nvidia"
  18. Option "NoLogo" "True"
  19. EndSection
  20. EOF
  21. else
  22. modprobe -q nouveau
  23. if [ -f /etc/X11/xorg.conf.d/01-nvidia.conf ] ; then
  24. rm /etc/X11/xorg.conf.d/01-nvidia.conf
  25. fi
  26. if [[ $(eselect opengl show) != xorg-x11 ]] ; then
  27. eselect opengl set xorg-x11 &>/dev/null
  28. fi
  29. fi
Advertisement
Add Comment
Please, Sign In to add comment