summaryrefslogblamecommitdiffstats
path: root/src/testApp.sh
blob: 61f7c2d3d971f95131ef50779ef381b2927f34cb (plain) (tree)
1
2
3
4
5
6
7
8
9
         



                                                           

                                                                         
                
                                                                 

                                                  
                                                                            
                                                      
                                                                                         
         
              
                                                







                                                         
#!/bin/sh
# Script now simply passes all arguments to the fbgui call.
# Use: ./testApp.sh [OPTIONS] 
# OPTIONS:	-D, --debug
#               -u <url>, --url=<url>
#               -d <dir>, --download=<dir>    absolute dir for downloads.
#               -c <path>, --config=<path>    path to config file.
#               
script_path="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
# to get the path only - not the script name - add
working_path=`dirname "$script_path"`
display_id=$(grep -n $(whoami) /etc/passwd| head -n 1|awk -F : '{print $1}')
# Start QT's virtual framebuffer with proper displayID
/usr/local/Trolltech/Qt-4.7.1/bin/qvfb -width 1024 -height 768 -qwsdisplay :$display_id &
sleep 0.1
# Start fbgui.
$working_path/fbgui -display QVFb:$display_id $@
# Check if fbbrowser is not running, if so kill the qvfb.
if [ $(ps aux | grep -v grep | grep -c fbgui) -eq 1 ]
then
	echo "fbgui is still running ..."
else
	echo "fbgui stopped running, killing qvfb ..."
	killall qvfb
fi