Small bash script that automatically disables/enables intel xorg.conf upon switching to nvidia/intel gpu . This is needed for all owners of nvidia optimus machines that want to have custom config for intel driver like for example TearFree.
- sudo
- nvidia optimus hardware
- nvidia-390 driver or newer with prime-select installed
- Place 20-intel-conf in /etc/X11/xorg.conf.d/
- Place 1-prime-select in /usr/local/bin
- Run
sudo chmod +x 1-prime-select
- Switch gpu by running
sudo 1-prime-select intel
orsudo 1-prime-select nvidia
- Logout or reboot for changes to take effect
This intel configuration file is just an example that I use because without it I get horrible screen tearing.
Feel free to modify it to your needs.
Intel config file breaks nvidia driver if it stays enabled so this script just removes .conf extension so that xorg.conf
does not recognize it as module to load.