File syncmaster901b of Package jw-env

#! /bin/sh
# xrand --addmode has non-zero exit status on nonexistant display, 
# but xrandr --auto --output only issues a warning on nonexistant display.
# 2010-02-08, jw
# 2010-07-21, jw - using xrandr output in grep


VGA=VGA
LVDS=LVDS
xr=$(xrandr)
echo $xr | grep -q  VGA1 &&  VGA=VGA1
echo $xr | grep -q LVDS1 && LVDS=LVDS1
echo $xr | grep -q syncmaster901b && syncmaster901b=1
echo $xr | grep -q 1280x1024a && _1280x1024a=1

set -x
test $syncmaster901b ||\
xrandr --newmode syncmaster901b 108.0 1280 1328 1440 1688 1024 1025 1028 1066
test $_1280x1024a ||\
xrandr --newmode 1280x1024a     108.0 1280 1328 1440 1688 1024 1025 1028 1066
xrandr --addmode $VGA 1280x1024a 
xrandr --auto --output $VGA --mode 1280x1024a --above $LVDS
#xrandr --auto --output $VGA --mode 1280x1024a --right-of $LVDS

openSUSE Build Service is sponsored by