#!/bin/sh
echo "xinput --set-prop \"eGalaxTouch Virtual Device for Single\" 113 0" > /tmp/.xinitrc
cat /home/pi/.xinitrc >> /tmp/.xinitrc
# touchscreen controller
touch_dev=`cat /tmp/hw.config | grep touchscreen`
if test $touch_dev = "touchscreen=egalax1"
then
	echo "eGalax Inc. touchscreen Found. Loading Configuration."
## 	cat /home/pi/hwconf/egalax1_cal >  /usr/share/X11/xorg.conf.d/01-input.conf
## 	cat /home/pi/hwconf/egalax1_cal >  /usr/share/X11/xorg.conf.d/99-calibration.conf
fi
if test $touch_dev = "touchscreen=ilitek-tp"
then
##         echo "eGalax Inc. touchscreen Found. Loading Configuration." > /dev/kmsg
	cat /home/pi/hwconf/ilitek-tp_cal >  /usr/share/X11/xorg.conf.d/01-input.conf
	cat /home/pi/hwconf/ilitek-tp_cal >  /usr/share/X11/xorg.conf.d/99-calibration.conf
fi

if test $touch_dev = "touchscreen=egalax2"
then
        # configuration of STP-RAP45U2U-S series touch controller
##         echo "eGalax Inc. USB TouchController Found. Loading Configuration." > /dev/kmsg
	echo "## not used by egalax2" > /usr/share/X11/xorg.conf.d/01-input.conf
	echo "## not used by egalax2" > /usr/share/X11/xorg.conf.d/99-calibration.conf
fi
