#!/bin/sh

if lsmod | grep pvrsrvkm > /dev/null; then
  export QWS_DISPLAY=powervr
fi

if [ -e /opt/timesys/demos/transform ]; then
  export QWS_DISPLAY=`cat /opt/timesys/demos/transform`:${QWS_DISPLAY}
fi

if [ -e /etc/ts.dev ]; then
  export QWS_MOUSE_PROTO=Tslib:`cat /etc/ts.dev`
fi

case "$1" in
  start)
  		echo "Starting demo launcher"
        /opt/timesys/demos/demolauncher -qws &
        ;;
  stop)
  		echo "Killing demos"
  		killall demolauncher
  		;;
  *)
  		echo "Usage $0 {start|stop}"
  		exit 1
esac
 
