#!/bin/bash
#
# setup nvidia and fglrx drives
#
# /usr/lib/hiweed-xorg-drives/hiweed-xorg-drives.sh
#
# Depends:
# /usr/lib/hiweed-xorg-drives/nvidia.fakeroot.tar.gz
# /usr/lib/hiweed-xorg-drives/fglrx.fakeroot.tar.gz
## Change the resolution
do_fine(){
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.old
sed -ie 's/"1280x1024" //' /etc/X11/xorg.conf
ldconfig
}
## Setup drives fuction
do_nvidia(){
echo Setting nvidia drives...
cd /
tar zxf /usr/lib/hiweed-xorg-drives/nvidia.fakeroot.tar.gz
nvidia-xconfig
#depmod -a ; modprobe nvidia
echo Done
exit 0
}
do_fglrx(){
echo Setting fglrx drives...
cd /
tar zxf /usr/lib/hiweed-xorg-drives/fglrx.fakeroot.tar.gz
aticonfig --initial
aticonfig --overlay-type=Xv
#depmod -a ; modprobe nvidia
echo Done
exit 0
}
## test
#do_nvidia(){
# echo nvidia
#}
## test
#do_fglrx(){
# echo ati-fglrx
#}
## check for nvidia, fglrx card
depmod -a
if [ -n "`lspci |grep VGA |grep -i "nvidia"`" ]
then
driver="nvidia"
modprobe nvidia && do_nvidia
elif [ -n "`lspci |grep VGA |grep -i "ati "`" ]
then
modprobe fglrx
if [ "$?" == "0" ]
then
driver="fglrx"
do_fglrx
else
driver="randeon"
true
fi
elif [ -n "`lspci |grep VGA |grep -i "intel"`" ]
then
driver="i810"
fi
## no supported 3D Video Card
if [ -z "$driver" ]
then
echo -e "It looks like you don't have a supported 3D Video Card :(\n"
exit 1
fi
exit 0
-