From 5a0bfd79b2506a8a182da14a4230c3c01af7ef68 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 21 Jan 2010 17:16:04 +0100 Subject: Add new script localxrandr to autoconfigure xorg to use all currently attached monitors. --- localxrandr | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 localxrandr (limited to 'localxrandr') 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 +# +# 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 -- cgit v1.2.3