summaryrefslogtreecommitdiffstats
path: root/testApp.sh
diff options
context:
space:
mode:
authorNiklas2011-10-10 17:26:17 +0200
committerNiklas2011-10-10 17:26:17 +0200
commitc131ea55120adc0efe6d3b8f84f142a9e4cabf67 (patch)
tree5e1fb5f15b3e4bb41d6f514f53574a8694b05f31 /testApp.sh
parentnew veriosn of the fbgui src (same as in fbgui-ng) combined with my networkDi... (diff)
downloadfbgui-c131ea55120adc0efe6d3b8f84f142a9e4cabf67.tar.gz
fbgui-c131ea55120adc0efe6d3b8f84f142a9e4cabf67.tar.xz
fbgui-c131ea55120adc0efe6d3b8f84f142a9e4cabf67.zip
added new files
Diffstat (limited to 'testApp.sh')
-rwxr-xr-xtestApp.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/testApp.sh b/testApp.sh
new file mode 100755
index 0000000..054169d
--- /dev/null
+++ b/testApp.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Script now simply passes all arguments to the fbgui call.
+# Use: ./testApp.sh [OPTIONS]
+# OPTIONS:
+# -h, --help prints help
+# -D <level>, --debug=<level> sets debug level [0,1]
+# -u <url>, --url=<url> sets URL to load
+# -d <dir>, --download=<dir> sets download directory
+# -c <path>, --config=<path> sets path to config file
+# -t <path>, --trigger=<path> sets path to file triggering URL load
+# -s <path>, --serial=<path> sets path to serial number file
+#
+# Note: all path are expected to be absolute.
+QT_VERSION=Qt-4.7.2
+
+# clean /tmp/fbgui
+rm -rf /tmp/fbgui
+rm /tmp/fbgui_trigger
+
+# path to script (including script name)
+script_path="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
+
+# to get the path only: use dirname which strips the filename from a path
+working_path=`dirname "$script_path"`
+
+# construct unique display_id based on user, needed for multi-user qvfb usage
+display_id=$(grep -n $(whoami) /etc/passwd| head -n 1|awk -F : '{print $1}')
+
+# Start QT's virtual framebuffer with proper display_id
+/usr/local/Trolltech/$QT_VERSION/bin/qvfb -width 1024 -height 768 -qwsdisplay :$display_id &
+# quick sleep to wait for qvfb loading
+sleep 0.2
+# Start fbgui connecting to QVFb with display_id from above.
+$working_path/build/fbgui -display QVFb:$display_id $@
+# kill qvfb since fbgui stopped
+killall qvfb