File lvds 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

# no longer reliable with 11.3: xrandr exits zero for a nonexistant mode 
# on a nonexistant display. Let us check xrandr output instead.

VGA=VGA
LVDS=LVDS
xr=$(xrandr)
echo $xr | grep -q  VGA1 &&  VGA=VGA1
echo $xr | grep -q LVDS1 && LVDS=LVDS1

MODE=1024x768_60
set -x
xrandr --addmode $VGA $MODE || \
MODE=1024x768 &&        xrandr --addmode $VGA $MODE
xrandr --auto --output $VGA --mode $MODE --same-as $LVDS

openSUSE Build Service is sponsored by