| Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame^] | 1 | #!/bin/sh | 
 | 2 |  | 
 | 3 | set -e | 
 | 4 |  | 
 | 5 | if [ -x /usr/bin/qtdemo ]; then | 
 | 6 | 	QTDEMO="qtdemo" | 
 | 7 | else | 
 | 8 | 	QTDEMO="qtdemoE -qws" | 
 | 9 | fi | 
 | 10 |  | 
 | 11 | case "$1" in | 
 | 12 |   start) | 
 | 13 | 	echo "Starting qtdemo" | 
 | 14 | 	if [ -f /etc/profile.d/tslib.sh ]; then | 
 | 15 | 		. /etc/profile.d/tslib.sh | 
 | 16 | 	fi | 
 | 17 | 	if [ -e "$TSLIB_TSDEVICE" ]; then | 
 | 18 | 		if [ ! -f /etc/pointercal ]; then | 
 | 19 | 			/usr/bin/ts_calibrate | 
 | 20 | 		fi | 
 | 21 | 		if [ "$QTDEMO" = "qtdemo" ]; then | 
 | 22 | 			Xorg & | 
 | 23 | 			export DISPLAY=:0 | 
 | 24 | 			$QTDEMO & | 
 | 25 | 		else | 
 | 26 | 			QWS_MOUSE_PROTO=tslib:$TSLIB_TSDEVICE $QTDEMO & | 
 | 27 | 		fi | 
 | 28 | 	else | 
 | 29 | 		if [ "$QTDEMO" = "qtdemo" ]; then | 
 | 30 | 			Xorg & | 
 | 31 | 			export DISPLAY=:0 | 
 | 32 | 		fi | 
 | 33 | 		$QTDEMO & | 
 | 34 | 	fi | 
 | 35 | 	;; | 
 | 36 |   stop) | 
 | 37 | 	echo "Stopping qtdemo" | 
 | 38 | 	if [ "$QTDEMO" = "qtdemo" ]; then | 
 | 39 | 		killall Xorg | 
 | 40 | 		killall qtdemo | 
 | 41 | 	else | 
 | 42 | 		killall qtdemoE | 
 | 43 | 	fi | 
 | 44 | 	;; | 
 | 45 |   restart) | 
 | 46 | 	$0 stop | 
 | 47 | 	$0 start | 
 | 48 | 	;; | 
 | 49 |   *) | 
 | 50 | 	echo "usage: $0 { start | stop | restart }" >&2 | 
 | 51 | 	exit 1 | 
 | 52 | 	;; | 
 | 53 | esac | 
 | 54 |  | 
 | 55 | exit 0 |