This script didn't help. Save as xorgmaker.sh, do:
chmox +x xorgmaker.sh
./xorgmaker.sh
Make sure to run as root.
#!/bin/sh
#
# xorgmaker: A menu-based X.org configurator.
# Copyright (C) 2006-2007, Martin Ultima. All rights reserved.
#
# This is the extensively-rewritten one for Ultima 8.1 final.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
BLAH=`mcookie`
XORGCONF=/tmp/$BLAH-xorg.conf
alias dialog="dialog --backtitle 'X.org Configuration'"
showhelp() {
echo "Usage: $0"
exit
}
showversion() {
VERSION=`cat /etc/ultima-version`
echo "xorgmaker for $VERSION"
exit
}
exitout() {
rm /tmp/$BLAH-*
echo "xorgmaker canceled by user."
exit 1
}
case $1 in
-h) showhelp ;;
--help) showhelp ;;
-v) showversion ;;
-V) showversion ;;
--version) showversion ;;
esac
alias lspci="/sbin/lspci | grep VGA"
VIDEOCARD="`lspci | cut -d : -f 3`"
#
# BEGIN XORG.CONF FILE
#
cat >$XORGCONF <<EOF
# Generated by Ultima Linux's xorgmaker
# For more configuration options, see xorg.conf(5x)
# Detected video card: $VIDEOCARD
Section "Module"
Load "dbe"
SubSection "extmod"
Option "omit xfree-dga"
EndSubSection
Load "type1"
Load "freetype"
Load "glx"
EOF
#
# PROBE VIDEO CARD
#
GOODIDEA="vesa"
ENABLEDRI="NO"
if [ "`lspci | grep 'Intel'`" ]; then
GOODIDEA="i810"
ENABLEDRI="YES"
fi
if [ "`lspci | grep 'Matrox'`" ]; then
GOODIDEA="mga"
ENABLEDRI="YES"
fi
if [ "`lspci | grep 'NeoMagic'`" ]; then
GOODIDEA="neomagic"
fi
if [ "`lspci | grep 'SiS'`" ]; then
GOODIDEA="sis"
ENABLEDRI="YES"
fi
if [ "`lspci | grep 'S3'`" ]; then
GOODIDEA="s3"
ENABLEDRI="YES"
fi
if [ "`lspci | grep '3dfx'`" ]; then
GOODIDEA="tdfx"
ENABLEDRI="YES"
fi
if [ "`lspci | grep 'Trident'`" ]; then
GOODIDEA="trident"
fi
if [ "`lspci | grep 'Tseng'`" ]; then
# Does anyone even still use these? I had one in my 486
GOODIDEA="tseng"
fi
if [ "`lspci | grep '[Vv][Mm][Ww][Aa][Rr][Ee]'`" ]; then
GOODIDEA="vmware"
fi
if [ "`lspci | grep 'ATI'`" ]; then
GOODIDEA="ati"
fi
if [ "`lspci | grep '[Rr][Aa][Gg][Ee]' | grep '128'`" ]; then
GOODIDEA="r128"
ENABLEDRI="YES"
fi
if [ "`lspci | grep '[Rr][Aa][Dd][Ee][Oo][Nn]'`" ]; then
if [ -e /var/log/packages/fglrx-* ]; then
GOODIDEA="fglrx"
else
GOODIDEA="radeon"
fi
ENABLEDRI="YES"
fi
if [ "`lspci | grep '[Nn][Vv][Ii][Dd][Ii][Aa]'`" ]; then
if [ -e /var/log/packages/nvidia-* ]; then
GOODIDEA="nvidia"
else
GOODIDEA="nv"
fi
# And no, NVIDIA cards don't use DRI
fi
#
# DIRECT RENDERING
#
if [ "$ENABLEDRI" = "YES" ]; then
cat >>$XORGCONF <<EOF
Load "dri"
EOF
fi
#
# CONTINUING WITH XORG.CONF
#
cat >>$XORGCONF <<EOF
EndSection
Section "Files"
RgbPath "/usr/X11R6/lib/X11/rgb"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/CID/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/local/"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"
FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/"
EndSection
Section "ServerFlags"
# See xorg.conf(5x) if you need a list of available server flags.
# Most of the time you can just ignore these.
EndSection
Section "InputDevice"
Identifier "Keyboard1"
Driver "kbd"
Option "AutoRepeat" "500 30"
EOF
#
# KEYBOARD LAYOUT
#
#dialog --title "Keyboard Layout" --inputbox "Please enter the two-digit \
#country code to identify your keyboard. For example, the default 'us' chooses \
#a U.S.-style QWERTY keyboard, and 'de' is a German (Deutsch) layout. If in \
#doubt, leave as-is." 0 0 "us" 2>/tmp/$BLAH-kbd || exitout
#KEYBOARD=`cat /tmp/$BLAH-kbd`
KEYBOARD="us"
if [ "$KEYBOARD" = "us" ]; then
KBMODEL="pc103"
else
KBMODEL="pc105"
fi
cat >>$XORGCONF <<EOF
Option "XkbRules" "xorg"
Option "XkbModel" "$KBMODEL"
Option "XkbLayout" "$KEYBOARD"
EndSection
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
EOF
#
# MOUSE
#
#dialog --title "Mouse Type" --default-item "IMPS/2" --menu "Please select \
#the type of mouse your computer uses. If your mouse has a scroll wheel it is \
#likely 'IMPS/2'; otherwise, try 'PS/2' first. If unsure, try 'IMPS/2'." 0 0 0 \
#"Auto" "Auto-detect (not 100% guaranteed to work)" \
#"IMPS/2" "PS/2 or USB mouse with scroll wheel" \
#"PS/2" "PS/2 or USB mouse without scroll wheel" \
#"Microsoft" "Two-button serial mouse" \
#"MouseSystems" "Three-button serial mouse" \
#"IntelliMouse" "Serial mouse with scroll wheel" 2>/tmp/$BLAH-mouse || exitout
#MOUSE=`cat /tmp/$BLAH-mouse`
MOUSE="IMPS/2"
cat >>$XORGCONF <<EOF
Option "Protocol" "$MOUSE"
Option "Device" "/dev/mouse"
EOF
if [ "$MOUSE" = "IMPS/2" -o "$MOUSE" = "IntelliMouse" ]; then
cat >>$XORGCONF <<EOF
Option "ZAxisMapping" "4 5 6 7"
EOF
fi
if [ "$MOUSE" = "PS/2" -o "$MOUSE" = "Microsoft" ]; then
cat >>$XORGCONF <<EOF
Option "Emulate3Buttons"
EOF
fi
#
# MONITOR
#
cat >>$XORGCONF <<EOF
EndSection
Section "Monitor"
Identifier "Default Monitor"
EOF
dialog --title "Horizontal Sync" --default-item "31.5 - 57.0" --menu "Select \
the correct horizontal sync rate for your monitor from the list below. The \
sync rate determines which video resolutions can be displayed. If in doubt, \
just press Enter to go with the recommended default." 0 0 0 \
"31.5" " 640x480, 60Hz; bare minimum" \
"31.5 - 35.1" " 800x600, 56Hz" \
"31.5 - 37.9" " 800x600, 60Hz" \
"31.5 - 48.5" " 1024x768, 60Hz" \
"31.5 - 57.0" " 1024x768, 70Hz - RECOMMENDED" \
"31.5 - 64.3" "1280x1024 and higher, 60Hz" \
"31.5 - 79.0" "1280x1024 and higher, 74Hz" \
"31.5 - 82.0" "1280x1024 and higher, 76Hz" 2>/tmp/$BLAH-horiz || exitout
dialog --title "Vertical Sync" --default-item "50-90" --menu "Select the \
correct vertical sync rate for your monitor from the list below. Example \
refresh rates are given; you may want to check your monitor's documentation \
for further info. If in doubt, go with the default." 0 0 0 \
"50-70" "Usually 60Hz; good for older hardware or LCD flat-panels" \
"50-90" "Good for monitors designed for 85Hz - RECOMMENDED" \
"50-100" "Really high-resolution monitors, with very strong refresh rates" \
"40-150" "Extremely high-resolution - may cause damage to monitor!" \
2>/tmp/$BLAH-vert || exitout
HORIZ="`cat /tmp/$BLAH-horiz`"
VERT=`cat /tmp/$BLAH-vert`
cat >>$XORGCONF <<EOF
HorizSync $HORIZ
VertRefresh $VERT
EndSection
Section "Device"
Identifier "Default Video Card"
EOF
#
# VIDEO DRIVERS
#
dialog --title "Video Card" --default-item "$GOODIDEA" --menu "Please select \
a video card driver (if in doubt, go with the default '$GOODIDEA'). Note \
that drivers other than the recommended default may not support 3D graphics \
or other nice features!\n\nYour video card: $VIDEOCARD" 0 0 0 \
"vga" "Bare minimum - use only if nothing else works" \
"vesa" "Generic VESA driver - marginally nicer than 'vga'" \
"ati" "Generic ATI card" \
"r128" "ATI open-source Rage 128 driver" \
"radeon" "ATI open-source Radeon driver" \
"fglrx" "ATI proprietary driver - RECOMMENDED" \
"i810" "Intel integrated graphics" \
"mga" "Matrox graphics cards" \
"nv" "NVIDIA open-source driver" \
"nvidia" "NVIDIA proprietary driver - RECOMMENDED" \
"tdfx" "3dfx graphics cards" \
"fbdev" "Linux framebuffer device" \
"neomagic" "NeoMagic laptop chipsets" \
"s3" "S3 graphics cards" \
"s3virge" "S3 Virge graphics cards" \
"savage" "Savage-based graphics cards" \
"sis" "SiS graphics cards" \
"sisusb" "USB-based SiS graphics cards" \
"trident" "Trident graphics cards" \
"tseng" "Tseng ET4000-based cards" \
"v4l" "Video4Linux-compatible devices" \
"vmware" "VMware guest system" 2>/tmp/$BLAH-videocard \
|| exitout
VIDEODRIVER=`cat /tmp/$BLAH-videocard`
cat >>$XORGCONF <<EOF
Driver "$VIDEODRIVER"
EndSection
Section "Screen"
Identifier "Default Screen"
Device "Default Video Card"
Monitor "Default Monitor"
EOF
case $HORIZ in
31.5) DEFAULTSIZE="640x480" ;;
"31.5 - 35.1") DEFAULTSIZE="800x600" ;;
"31.5 - 37.9") DEFAULTSIZE="800x600" ;;
"31.5 - 48.5") DEFAULTSIZE="1024x768" ;;
"31.5 - 57.0") DEFAULTSIZE="1024x768" ;;
"31.5 - 64.3") DEFAULTSIZE="1280x1024" ;;
"31.5 - 79.0") DEFAULTSIZE="1280x1024" ;;
"31.5 - 82.0") DEFAULTSIZE="1280x1024" ;;
*) DEFAULTSIZE="1024x768" ;;
esac
dialog --title "Screen Resolution" --default-item "$DEFAULTSIZE" --menu \
"Please select your preferred screen resolution from the list below. A \
default has been automatically chosen based on the refresh rate you provided \
earlier. If in doubt, go with '$DEFAULTSIZE'." 0 0 0 \
"640x480" "VGA; bare minimum resolution" \
"800x600" "SVGA" \
"1024x768" "XGA; recommended for most machines" \
"1152x864" "XGA+" \
"1280x800" "WXGA" \
"1280x1024" "SXGA" \
"1400x1050" "WSXGA+" \
"1600x1200" "UXGA" 2>/tmp/$BLAH-resolution || exitout
dialog --title "Color Depth" --default-item 16 --menu "Please select your \
preferred color depth from the list below. If in doubt, try 16-bit." 0 0 0 \
"8" "256 colors" \
"16" "16-bit color (recommended)" \
"24" "24- or 32-bit color" 2>/tmp/$BLAH-depth || exitout
RESOLUTION=`cat /tmp/$BLAH-resolution`
DEPTH=`cat /tmp/$BLAH-depth`
case $RESOLUTION in
640x480) MODES='"640x480"' ;;
800x600) MODES='"800x600" "640x480"' ;;
1024x768) MODES='"1024x768" "800x600" "640x480"' ;;
1152x864) MODES='"1152x864" "1024x768" "800x600" "640x480"' ;;
1280x800) MODES='"1280x800" "1024x768" "800x600" "640x480"' ;;
1280x1024) MODES='"1280x1024" "1024x768" "800x600" "640x480"' ;;
1400x1050) MODES='"1400x1050" "1280x1024" "1024x768" "800x600" "640x480"' ;;
1600x1200) MODES='"1600x1200" "1280x1024" "1024x768" "800x600" "640x480"' ;;
esac
cat >>$XORGCONF <<EOF
DefaultDepth $DEPTH
Subsection "Display"
Depth 8
Modes $MODES
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 16
Modes $MODES
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 24
Modes $MODES
ViewPort 0 0
EndSubsection
EndSection
Section "ServerLayout"
Identifier "Simple Layout"
Screen "Default Screen"
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection
EOF
if [ "$ENABLEDRI" = "YES" ]; then
cat >>$XORGCONF <<EOF
Section "DRI"
Mode 0666
EndSection
EOF
fi
cat >>$XORGCONF <<EOF
# That's all, folks!
EOF
#
# DONE
#
cat /etc/X11/xorg.conf >/etc/X11/xorg.conf-BACKUP
cat $XORGCONF >/etc/X11/xorg.conf
if [ "`ps -A | grep X`" ]; then
XMESSAGE="Restart your computer or press Ctrl-Alt-Backspace to start \
using your new settings (this will exit any programs you have running)."
fi
dialog --timeout 30 \
--title "Configuration Complete" --no-cancel --msgbox "Your new \
configuration has been saved. $XMESSAGE" 0 0
rm /tmp/$BLAH-*