diff options
author | Jonas Smedegaard <dr@jones.dk> | 2010-01-21 17:16:04 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2010-01-21 17:16:04 +0100 |
commit | 5a0bfd79b2506a8a182da14a4230c3c01af7ef68 (patch) | |
tree | 3e936471dc8cd2ecb797fa68e8b07a1bb506dfab /localxrandr | |
parent | 75bf87a29e5695515854703fce86eafea325b45e (diff) |
Add new script localxrandr to autoconfigure xorg to use all currently attached monitors.
Diffstat (limited to 'localxrandr')
-rwxr-xr-x | localxrandr | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/localxrandr b/localxrandr new file mode 100755 index 0000000..17d773e --- /dev/null +++ b/localxrandr @@ -0,0 +1,62 @@ +#!/bin/sh +# +# /usr/local/bin/localwebgalleryupdate +# Copyright 2009-2010 Jonas Smedegaard <dr@jones.dk> +# +# Autoconfigure Xorg to use all currently connected monitors +# + +xinerama=1 + +lcd= +vga= +dvi= +tv= +for output in $(xrandr | egrep '^[^ ]+ connected' | awk '{print $1}'); do + case $output in + LVDS|LVDS1) + lcd="$output" + ;; + VGA) + vga="$output" + ;; + TMDS-1|DVI1) + dvi="$output" + ;; + TV) + tv="$output" + ;; + *) + echo "Unknown output \"$output\"" + ;; + esac +done + +if [ -n "$lcd" ] && [ -n "$dvi" ]; then + if [ -n "$xinerama" ]; then + xrandr \ + --output "$lcd" --mode 1280x800 --rotate normal \ + --output "$dvi" --mode 1680x1050 --rotate normal --above $lcd --preferred +# xrandr \ +# --output "$lcd" --mode 1280x800 --rotate left \ +# --output "$dvi" --mode 1680x1050 --rotate left --right-of $lcd + else + xrandr --output "$dvi" --mode 1280x800 + fi +else + xrandr --auto +fi + +## Mirrored screen, needs virtual screen min 1680x1050 +# xrandr --output TMDS-1 --mode 1680x1050 +## Mirrored screen matching internal screen, needs virtual screen min 1280x800 +# xrandr --output TMDS-1 --mode 1280x800 +## Xinerama horisontal (low-res), needs virtual screen min 1920x768 +# xrandr --output LVDS --mode 640x480 +# xrandr --output TMDS-1 --right-of LVDS --mode 1280x768 +## Xinerama horisontal, needs virtual screen min 1680x1850 +# xrandr --output LVDS --mode 1280x800 +# xrandr --output TMDS-1 --above LVDS --mode 1680x1050 +#else +# xrandr --auto +#fi |