summaryrefslogtreecommitdiff
path: root/localxrandr
blob: ed1816db17607cac7858da59b88eae3cb188d6e1 (plain)
  1. #!/bin/sh
  2. #
  3. # /usr/local/bin/localwebgalleryupdate
  4. # Copyright 2009-2010 Jonas Smedegaard <dr@jones.dk>
  5. #
  6. # Autoconfigure Xorg to use all currently connected monitors
  7. #
  8. xinerama=1
  9. lcd=
  10. vga=
  11. dvi=
  12. tv=
  13. for output in $(xrandr | egrep '^[^ ]+ connected' | awk '{print $1}'); do
  14. case $output in
  15. LVDS|LVDS1|LVDS-1)
  16. lcd="$output"
  17. ;;
  18. VGA)
  19. vga="$output"
  20. ;;
  21. TMDS-1|DVI1|DVI-I-1)
  22. dvi="$output"
  23. ;;
  24. TV)
  25. tv="$output"
  26. ;;
  27. *)
  28. echo "Unknown output \"$output\""
  29. ;;
  30. esac
  31. done
  32. if [ -n "$lcd" ] && [ -n "$dvi" ]; then
  33. if [ -n "$xinerama" ]; then
  34. xrandr \
  35. --output "$lcd" --mode 1280x800 --rotate normal \
  36. --output "$dvi" --mode 1680x1050 --rotate normal --above $lcd --preferred
  37. # xrandr \
  38. # --output "$lcd" --mode 1280x800 --rotate left \
  39. # --output "$dvi" --mode 1680x1050 --rotate left --right-of $lcd
  40. else
  41. xrandr --output "$dvi" --mode 1280x800
  42. fi
  43. else
  44. xrandr --auto
  45. fi
  46. ## Mirrored screen, needs virtual screen min 1680x1050
  47. # xrandr --output TMDS-1 --mode 1680x1050
  48. ## Mirrored screen matching internal screen, needs virtual screen min 1280x800
  49. # xrandr --output TMDS-1 --mode 1280x800
  50. ## Xinerama horisontal (low-res), needs virtual screen min 1920x768
  51. # xrandr --output LVDS --mode 640x480
  52. # xrandr --output TMDS-1 --right-of LVDS --mode 1280x768
  53. ## Xinerama horisontal, needs virtual screen min 1680x1850
  54. # xrandr --output LVDS --mode 1280x800
  55. # xrandr --output TMDS-1 --above LVDS --mode 1680x1050
  56. #else
  57. # xrandr --auto
  58. #fi