summaryrefslogtreecommitdiff
path: root/recipes-qt/qt-demo/qt-demo-init/qtdemo-init
blob: b71cbc8327209a545dbf198b02346ca78ae92e88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh

set -e

if [ -f /usr/bin/qtdemo ]; then
	QTDEMO="qtdemo > /var/log/Xsession.log 2> &1"
else
	QTDEMO="qtdemoE -qws"
	export QWS_DISPLAY="LinuxFb:/dev/fb:genericcolors"
	export QWS_KEYBOARD="USB:/dev/input/event-keyboard"
	export QWS_MOUSE_PROTO="LinuxInput:/dev/input/event-mouse"
fi

case "$1" in
  start)
	echo "Starting qtdemo"
#	if [ -f /etc/profile.d/tslib.sh ]; then
#		source /etc/profile.d/tslib.sh
#		:
#	fi
#	if [ -e "$TSLIB_TSDEVICE" ]; then
#		if [ ! -f /etc/pointercal ]; then
#			/usr/bin/ts_calibrate
#		fi
#		if [ "$QTDEMO" == qtdemo ]; then
#			Xorg &
#			export DISPLAY=:0
#			$QTDEMO &
#		else
#			QWS_MOUSE_PROTO=tslib:$TSLIB_TSDEVICE $QTDEMO &
#		fi
#	else
		if [ "$QTDEMO" == qtdemo ]; then
			Xorg &
			export DISPLAY=:0
		fi
		$QTDEMO &
#	fi
	;;
  stop)
	echo "Stopping qtdemo"
	if [ "$QTDEMO" == qtdemo ]; then
		killall Xorg
		killall qtdemo
	else
		killall qtdemoE
	fi
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "usage: $0 { start | stop | restart }" >&2
	exit 1
	;;
esac

exit 0