summaryrefslogtreecommitdiffstats
path: root/run.sh
blob: 1c3d15f69806db9049e4cd655e17bc585fec79cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# set your QT version here
QT_VERSION=4.7.2

# qvfb's width
QVFB_WIDTH=800
# qvfb's height
QVFB_HEIGHT=600

# 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-$QT_VERSION/bin/qvfb -width $QVFB_WIDTH -height $QVFB_HEIGHT -qwsdisplay :$display_id &

# quick sleep to wait for qvfb loading
sleep 0.2

# Start fbsplash connected to QVFb with display_id from above.
$working_path/build/fbsplash -display QVFb:$display_id $@
killall qvfb