laptop-monitorfix 758 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. # The script I used since like 2009:
  3. #use "cvt 1280 768 60.00" to get the modeline
  4. #(Thu Apr 12@08:35 PM)(tyler@Tilers)(~)
  5. # xrandr --newmode 1280x768_60.00 80.14 1280 1344 1480 1680 768 769 772 795 -HSync +Vsync
  6. #(Thu Apr 12@08:36 PM)(tyler@Tilers)(~)
  7. # xrandr --addmode VGA1 1280x768_60.00
  8. #(Thu Apr 12@08:36 PM)(tyler@Tilers)(~)
  9. # xrandr --output VGA1 --mode 1280x768_60.00 --primary
  10. # Turn off Laptop display:
  11. #xrandr --output LVDS1 --off
  12. # New school
  13. laptop="LVDS1"
  14. vga="VGA1"
  15. if xrandr | grep -q "$vga connected"; then
  16. xrandr --newmode 1280x768_60.00 80.14 1280 1344 1480 1680 768 769 772 795 -HSync +Vsync
  17. xrandr --addmode VGA1 1280x768_60.00
  18. xrandr --output $IN --off --output VGA1 --mode 1280x768_60.00 --primary
  19. fi