SZ72B init script
From MalaWiki
Back to Vaio VGN-SZ72B.
#!/bin/sh
# colors
black='\e[0;47m'
red='\e[0;31m'
green='\e[0;32m'
yellow='\e[0;33m'
blue='\e[0;34m'
magenta='\e[0;35m'
cyan='\e[0;36m'
white='\e[0;37m'
clear='\e[0m'
# Detect video chipset in use
LSPCI=/usr/bin/lspci
GREP=/bin/grep
VAIOFILE=/etc/vaio-sz
in_pciid='00:02.0 0300: 8086:27a2'
nv_pciid='01:00.0 0300: 10de:01d8'
intel_detected=1
nvidia_detected=1
$LSPCI -n | $GREP -q "$in_pciid" ; intel_detected=$?
$LSPCI -n | $GREP -q "$nv_pciid" ; nvidia_detected=$?
# write file with our findings
rm -f $VAIOFILE
if [ "$intel_detected" = "0" ] ; then
echo "intel_detected=1" > $VAIOFILE
echo "nvidia_detected=0" >> $VAIOFILE
elif [ "$nvidia_detected" = "0" ] ; then
echo "intel_detected=0" > $VAIOFILE
echo "nvidia_detected=1" >> $VAIOFILE
fi
rm -f /etc/X11/xorg.conf
if [ "$intel_detected" = "0" ] ; then
echo -e "VAIO SZ72B/B: ${green}Intel 945GM detected${clear}"
ln -s /etc/X11/xorg.conf.i810 /etc/X11/xorg.conf
elif [ "$nvidia_detected" = "0" ] ; then
echo -e "VAIO SZ72B/B: ${green}NVidia detected.${clear}"
ln -s /etc/X11/xorg.conf.nvidia /etc/X11/xorg.conf
else
echo -e "VAIO SZ72B/B: ${red}unable to detect video chipset.${clear}"
fi