summaryrefslogtreecommitdiffstats
path: root/run.sh
diff options
context:
space:
mode:
authorJonathan Bauer2011-06-16 16:36:14 +0200
committerJonathan Bauer2011-06-16 16:36:14 +0200
commit0b99cfa6550c1828294aaca9b64eb7517f1e729f (patch)
tree75452cd1d3c7b696db9dc7c9ced3019c053ed642 /run.sh
parentinitial import (diff)
downloadfbsplash-0b99cfa6550c1828294aaca9b64eb7517f1e729f.tar.gz
fbsplash-0b99cfa6550c1828294aaca9b64eb7517f1e729f.tar.xz
fbsplash-0b99cfa6550c1828294aaca9b64eb7517f1e729f.zip
CMakeLists, main class and build/run scripts
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/run.sh b/run.sh
new file mode 100755
index 0000000..098b060
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# 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-4.7.2/bin/qvfb -width 1024 -height 768 -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