summaryrefslogtreecommitdiff
path: root/recipes/freondemo/files
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/freondemo/files')
-rwxr-xr-x[-rw-r--r--]recipes/freondemo/files/freondemo34
-rw-r--r--recipes/freondemo/files/freondemo.init7
2 files changed, 26 insertions, 15 deletions
diff --git a/recipes/freondemo/files/freondemo b/recipes/freondemo/files/freondemo
index 80dd36e132..bd8a3b609f 100644..100755
--- a/recipes/freondemo/files/freondemo
+++ b/recipes/freondemo/files/freondemo
@@ -1,20 +1,32 @@
#!/bin/sh
# We start a system wide gstd daemon
-gstd &
-
-amixer -q sset 'HP DAC' 127
+if ! pidof gstd > /dev/null; then
+ { gstd 2>&1 | logger -t GSTD & } ;
+fi
+
+
+amixer -q sset 'HP DAC' 127
+amixer -q sset 'Line DAC' 127
#If we detect a mouse, use it, otherwise configure the touchcreen
-if [ ! -c /dev/input/mice ] && [ ! -c /dev/input/mouse0 ] ; then
- if [ -c /dev/input/touchscreen0 ] ; then
- export TSLIB_TSDEVICE=/dev/input/touchscreen0
- if [ ! -f /etc/pointercal ] ; then
- # We need to calibrate the screen
- ts_calibrate
- fi
- export QWS_MOUSE_PROTO=tslib
+if ! grep -q mouse1 /proc/bus/input/devices ; then
+ if grep -q Touchscreen /proc/bus/input/devices && [ -c /dev/input/touchscreen0 ] ; then
+ export TSLIB_TSDEVICE=/dev/input/touchscreen0
+ if [ ! -f /etc/pointercal ] ; then
+ # We need to calibrate the screen
+ ts_calibrate
+ fi
+ echo -e "\nFreonDemo using touchscreen"
+ export QWS_MOUSE_PROTO=tslib:/dev/input/touchscreen0
+ else
+ echo "ERROR, no mouse or touchscreen detected for FreonDemo"
+ exit 1;
fi
+else
+ echo -e "\nFreonDemo using mouse input"
+ export QWS_MOUSE_PROTO=MouseMan:/dev/input/mouse1
fi
+#Otherwise try to use the touchscren
/usr/libexec/FreonDemo -qws &
diff --git a/recipes/freondemo/files/freondemo.init b/recipes/freondemo/files/freondemo.init
index 5cb5281245..3b406b2968 100644
--- a/recipes/freondemo/files/freondemo.init
+++ b/recipes/freondemo/files/freondemo.init
@@ -4,7 +4,7 @@ set -e
DAEMON=/usr/bin/freondemo
NAME=freondemo
-PIDFILE=/var/run/freondemo/pid
+PIDFILE=/var/run/freondemo.pid
DESC="Freon Demo"
PARAMS=""
@@ -22,10 +22,9 @@ start_it_up()
fi
fi
- source $SESSIONFILE
echo -n "Starting $DESC: "
- start-stop-daemon --start --pidfile $PIDFILE \
- --exec $DAEMON -- $PARAMS
+ start-stop-daemon --start --exec $DAEMON -- $PARAMS
+ pidof FreonDemo > $PIDFILE
echo "$NAME."
}