on 7.90+14.10.20140703.1-0ubuntu1 help sign in
unity8/run.sh
83 lines 2.5 kB history raw
1#!/bin/sh
3. /etc/environment
4export QML2_IMPORT_PATH
6QML_PHONE_SHELL_PATH=./builddir/src/unity8
7GDB=false
8FAKE=false
9PINLOCK=false
10KEYLOCK=false
11MOUSE_TOUCH=true
13usage() {
14 echo "usage: "$0" [OPTIONS]\n" >&2
15 echo "Script to run the shell.\n" >&2
16 echo "OPTIONS:" >&2
17 echo " -f, --fake Force use of fake Qml modules." >&2
18 echo " -p, --pinlock Use a pin protected user." >&2
19 echo " -k, --keylock Use a passphrase protected user." >&2
20 echo " -g, --gdb Run through gdb." >&2
21 echo " -h, --help Show this help." >&2
22 echo " -m, --nomousetouch Run without -mousetouch argument." >&2
23 echo >&2
24 exit 1
27ARGS=`getopt -n$0 -u -a --longoptions="fake,pinlock,keylock,gdb,help,nomousetouch" -o "fpkghm" -- "$@"`
28[ $? -ne 0 ] && usage
29eval set -- "$ARGS"
31while [ $# -gt 0 ]
32do
33 case "$1" in
34 -f|--fake) FAKE=true;;
35 -p|--pinlock) PINLOCK=true;;
36 -k|--keylock) KEYLOCK=true;;
37 -g|--gdb) GDB=true;;
38 -h|--help) usage;;
39 -m|--nomousetouch) MOUSE_TOUCH=false;;
40 --) shift;break;;
41 esac
42 shift
43done
45if $FAKE; then
46 export QML2_IMPORT_PATH=$QML2_IMPORT_PATH:$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
47 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/LightDM/single
48fi
50if $PINLOCK; then
51 export QML2_IMPORT_PATH=$QML2_IMPORT_PATH:$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
52 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/LightDM/single-pin
53fi
55if $KEYLOCK; then
56 export QML2_IMPORT_PATH=$QML2_IMPORT_PATH:$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
57 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/LightDM/single-passphrase
58fi
60QML_PHONE_SHELL_ARGS=""
61if $MOUSE_TOUCH; then
62 QML_PHONE_SHELL_ARGS="$QML_PHONE_SHELL_ARGS -mousetouch"
63fi
65control_c()
67 /sbin/initctl stop unity8
68 exit $?
71trap control_c INT
73if $GDB; then
74 gdb -ex run --args $QML_PHONE_SHELL_PATH $QML_PHONE_SHELL_ARGS $@
75else
76 status=`/sbin/initctl status unity8`
77 if [ "$status" != "unity8 stop/waiting" ]; then
78 echo "Unity8 is already running, please stop it first"
79 exit 1
80 fi
81 /sbin/initctl start unity8 BINARY="`readlink -f $QML_PHONE_SHELL_PATH` $QML_PHONE_SHELL_ARGS $@" QML2_IMPORT_PATH=$QML2_IMPORT_PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH
82 tailf -n 0 ~/.cache/upstart/unity8.log
83fi