summaryrefslogtreecommitdiffstats
path: root/run.sh
blob: c0e7ad31a8450137d8b250c5996cbdbbb41fea43 (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
28
29
30
31
32
33
#!/bin/bash
# All args are passed to fbsplash.
# Set the QT version of the qvfb here
QT_VERSION=Qt-4.7.2

# clear socket, needed? crashes without...
rm /tmp/foo >/dev/null

if [ $# -eq 2 ]
then
  QVFB_WIDTH=$1
  QVFB_HEIGHT=$2
else
  # qvfb's size
  QVFB_WIDTH=800
  QVFB_HEIGHT=600
fi

# path to script
script_path=$(dirname $(readlink -f $0))

# 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 $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.
$script_path/bin/fbsplash -display QVFb:$display_id $@
killall qvfb