#!/bin/sh # helper script for installing the required modules for touchscreen operation # on a developer workstation WHERE="/tmp/touchscreen" if [ -f ./fetchtouchdrivers.sh ] ; then . ./fetchtouchdrivers.sh RC=${?} if [ ${RC} -gt 0 ] ; then echo "there was a problem fetching the touchscreen driver binaries from subversion" echo "please check failure output and try again." exit 1 fi else echo "huups... I'm unable to find the script './fetchtouchdrivers.sh'" echo "don't know how to handle this, I'm so sorry :(" fi if [ -f ./touchscreen_driver.tgz ] ; then [ ! -d ${WHERE} ] && mkdir ${WHERE} cat ./touchscreen_driver.tgz | (cd ${WHERE}; tar -xzf -) else if [ ! -d ${WHERE}/ -a -f /tmp/touchscreen_driver.tgz ] ; then mkdir ${WHERE} cd ${WHERE} tar -xzf /tmp/touchscreen_driver.tgz fi fi if [ -f ${WHERE}/utouch.ko -a -f ${WHERE}/utouch_drv.so ] ; then cp ${WHERE}/utouch.ko /boot/modules/utouch.ko || echo "utouch.ko failed to copy" cp ${WHERE}/utouch_drv.so /usr/local/lib/xorg/modules/input/utouch_drv.so || \ echo "utouch_drv.so failed to copy" [ -z '`grep -i utouch /boot/loader.conf | grep YES`' ] && \ echo "adding loader settings..." && \ echo 'utouch_load="YES"' >> /boot/loader.conf if [ -z '`grep -i touchscreen /etc/X11/xorg.conf`' ] ; then echo "adding X.Org settings..." [ ! -f /etc/X11/xorg.conf.notouch ] && cp /etc/X11/xorg.conf /etc/X11/xorg.conf.notouch # add xorg config cat << EOF >> /etc/X11/xorg.conf Section "InputDevice" Identifier "Touchscreen1" Driver "utouch" Option "Device" "/dev/utouch0" Option "SendDragEvents" "true" Option "DebugLevel" "0" Option "Threshold" "20" Option "FilterNear" "4" Option "FilterFar" "0" Option "FilterFirstPress" "0" Option "FilterRelease" "True" Option "Invert Y" "True" Option "Rotate" "left" #Option "Rotate" "right" Option "ConfigFile" "/var/static/utouch.conf" Option "Min X" "400" Option "Max X" "1500" Option "Min Y" "900" Option "Max Y" "1600" EndSection EOF echo "we need to add Inputdevice Touchscreen1 to the serverlayout..." echo 'Please (manually) add the following to your "ServerLayout" configuration' echo "" echo 'InputDevice "Touchscreen1" "SendCoreEvents"' fi if [ -f ${WHERE}/xorg.conf ] ; then cp ${WHERE}/xorg.conf /etc/X11/xorg.conf.touchscreen.sample echo "a (working) sample configuration file has been provided as" echo "/etc/X11/xorg.conf.touchscreen.sample" echo "you may use that file to change your configuration" fi # should we remove ${WHERE} now? it's just a temporary work area #rm -r ${WHERE} fi echo "done!"