I didn't know it was just that one MagicGraph that causes the problem -- this way it's quite easy to make the workaround
Yes, it's not nice to make HW-specific code, but you can't help it, as there's all this defective HW! In some cases -- the modified pcmcia cards in Acer laptops and the fix Pakt posted is a good example -- you can solve it nicely, but in others...
Anyway, here's an improvement to your code:
(my version of the wizard is somewhat different to Barry's, so I'm just posting the relevant block.)
From the results of my HW-Test dotpup that people sent me, I noticed that there were some cases where ddcprobe gave more modes than Xvesa, so I figured: why no use both?
So what I do is use both ddcprobe and Xvesa -listmodes, and if the dubious HW is detected, just skip Xvesa...
Code: Select all
if [ -f /usr/X11R7/bin/Xvesa ];then #format of each line: 1024x768x16
# Dougal: use both Xvesa and ddcprobe output to find modes
## Dougal: skip Xvesa for dubious Toshiba HW
if ! grep -Fq 'oem: MagicGraph 256 AV 44K PRELIMINARY' /tmp/ddcprobe.txt;then
Xvesa -listmodes 2>&1 | cut -f2 -d' ' | grep -E 'x16$|x24$' > /tmp/Xmodes.tmp
fi
grep '^mode:' /tmp/ddcprobe.txt | grep -E 'x64k|x16m'| cut -f2 -d' ' | sed -e 's/x64k/x16/g ; s/x16m/x24/g' >> /tmp/Xmodes.tmp
sort --field-separator=x --numeric-sort /tmp/Xmodes.tmp | uniq >/tmp/Xmodes.txt
rm -f /tmp/Xmodes.tmp
else