#!/bin/sh set -e if [ -f /usr/bin/qtdemo ]; then QTVARIANT="X11" QTDEMO="qtdemo > /var/log/Xsession.log 2>&1" else QTVARIANT="" QTDEMO="qtdemoE -qws" 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 [ "$QTVARIANT" == X11 ]; then Xorg & export DISPLAY=:0 eval $QTDEMO & else QWS_MOUSE_PROTO=tslib:$TSLIB_TSDEVICE $QTDEMO & fi else if [ -e "/usr/bin/xinput_calibrator_once.sh" ]; then xinput_calibrator_once.sh fi if [ "$QTVARIANT" == X11 ]; then Xorg & export DISPLAY=:0 fi eval $QTDEMO & fi ;; stop) echo "Stopping qtdemo" if [ "$QTVARIANT" == X11 ]; 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