#!/bin/sh
# chkconfig: 2345 98 02
### BEGIN INIT INFO
# Provides:          timesys-theatre
# Required-Start:    $local_fs
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Should-Start:      fb
# Short-Description: Start timesys-theatre at boot time
# Description:       Enable service provided by timesys-theatre.
# X-Start-Before:    
# X-Stop-After:      
# X-Timesys-Start-Number:  98
# X-Timesys-Stop-Number:  02
### END INIT INFO

PATH=/usr/bin:/bin:/usr/sbin:/sbin
QWS_MOUSE_PROTO=
TSDEV=
MOUSEDEV=

# Have Qt detect each mouse device registered on the board
if [ -e /etc/ts.dev ] ; then
    TSDEV=`cat /etc/ts.dev`
	QWS_MOUSE_PROTO="Tslib:$TSDEV"
fi
if [ -e /etc/mouse.dev ] ; then
	MOUSEDEV=`cat /etc/mouse.dev`
	QWS_MOUSE_PROTO="$QWS_MOUSE_PROTO LinuxInput:$MOUSEDEV "
fi
export QWS_MOUSE_PROTO
export QWS_DISPLAY=LinuxFb:/dev/fb0

case "$1"  in
  start)
    echo "Starting demo..."
    timesys-theatre-1080p -qws &
  ;;
  *)
  ;;
esac
