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










                                                                 
                                                                            

                                
                                                                                        



                                                                            
                                                     







                                                         
#!/bin/sh
# This script now needs to have the URL to load as an argument.
if [ $# = 0 ]; then
  echo "No URL passed, exiting..."
  exit
fi

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
/usr/local/Trolltech/Qt-4.7.1/bin/qvfb -width 800 -height 600 -qwsdisplay :$display_id &
# Wait for it to load (needed?)
sleep 1
# Start the fbbrowser app.
# This requires the fbgui git repository to be in the user's home directory.
$working_path/fbgui -qws -display QVFb:$display_id $1
# 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