#!/bin/sh # Script now simply passes all arguments to the fbgui call. # Use: ./testApp.sh [OPTIONS] # OPTIONS: # -h, --help prints help # -D , --debug= sets debug level [0,1] # -u , --url= sets URL to load # -d , --download= sets download directory # -c , --config= sets path to config file # -t , --trigger= sets path to file triggering URL load # -s , --serial= sets path to serial number file # # Note: all path are expected to be absolute. QT_VERSION=Qt-4.7.2 # clean /tmp/fbgui [ -d /tmp/fbgui ] && rm -rf /tmp/fbgui [ -f /tmp/fbgui_trigger ] && 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/src/fbgui/fbgui -display QVFb:$display_id $@ # kill qvfb since fbgui stopped killall qvfb