Code: Select all
#v3.93 rerwin: For some Tecra and Portege laptops, avoid an Xvesa hang by skipping "listmodes" and letting the user choose the appropriate video mode. #rerwin begin
#note, -F means any line to match
XVESALISTOK="yes"
if grep -q -F 'oem: MagicGraph 256 AV 44K PRELIMINARY
oem: Trident Cyber 8820' /tmp/ddcprobe.txt;then
#HORIZSYNC=""
#VERTREFRESH=""
XVESALISTOK="no"
[ "`grep 'mode: 640x480x64k' /tmp/ddcprobe.txt`" = "" ] && echo 'mode: 640x480x64k' >> /tmp/ddcprobe.txt
[ "`grep 'mode: 640x480x16m' /tmp/ddcprobe.txt`" = "" ] && echo 'mode: 640x480x16m' >> /tmp/ddcprobe.txt
[ "`grep 'mode: 800x600x64k' /tmp/ddcprobe.txt`" = "" ] && echo 'mode: 800x600x64k' >> /tmp/ddcprobe.txt
[ "`grep 'mode: 800x600x16m' /tmp/ddcprobe.txt`" = "" ] && echo 'mode: 800x600x16m' >> /tmp/ddcprobe.txt
fi #rerwin end
#modes supported by card...
CARDCHOICES=""
if [ -f /usr/X11R7/bin/Xvesa -a "$XVESALISTOK" = "yes" ];then #format of each line: 1024x768x16
Xvesa -listmodes 2>&1 | cut -f 2 -d ' ' | grep --extended-regexp 'x16$|x24$' | sort --field-separator=x --numeric-sort > /tmp/Xmodes.txt
else
#the vesa 'mode:' lines returned by ddcprobe are very limited...
grep '^mode:' /tmp/ddcprobe.txt | grep -E 'x64k|x16m'| cut -f 2 -d ' ' | sed -e 's/x64k/x16/g ; s/x16m/x24/g' > /tmp/Xmodes.txt
fi