fix_intel_video_tearing.sh 696 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. # fail if any commands fails
  3. set -e
  4. # debug log
  5. #set -x
  6. # Set superuser privileges command if not set
  7. if [[ -z $su ]]; then
  8. export su="sudo"
  9. fi
  10. cd || return
  11. echo ""
  12. echo -e "\033[33;5m If using laptop, unplug any external displays if connected... \033[0m"
  13. echo ""
  14. read -rp "Press enter when finish..."
  15. {
  16. echo "Section \"Device\""
  17. echo " Identifier \"Intel Graphics\""
  18. echo " Driver \"intel\""
  19. echo " Option \"TearFree\" \"true\""
  20. echo "EndSection"
  21. } | $su tee -a /etc/X11/xorg.conf.d/20-intel.conf
  22. output=$(xrandr | grep " connected " | awk '{print $1;}')
  23. echo "To enable immediately just type: '$ xrandr --output $output --set TearFree on'"