diff options
author | root <root@jones.dk> | 2010-02-01 21:39:37 +0100 |
---|---|---|
committer | root <root@jones.dk> | 2010-02-01 21:39:37 +0100 |
commit | bd603ffdbf1fe23c901a4840a49fa1fbf3813e72 (patch) | |
tree | d70aee617464917fd2d4e1e1a8c373d48736febb | |
parent | 2dac6c15d822f51b96c7d2ca4b74cabf11d4079e (diff) | |
parent | 5a0bfd79b2506a8a182da14a4230c3c01af7ef68 (diff) |
Merge branch 'master' of git://source.jones.dk/bin
-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 |