on 577eaad help sign in
unity8/run
72 lines 2.2 kB history raw
1#!/bin/sh
3QML_PHONE_SHELL_PATH=./builddir/unity8
4GDB=false
5FAKE=false
6PINLOCK=false
7KEYLOCK=false
8MOUSE_TOUCH=true
10usage() {
11 echo "usage: "$0" [OPTIONS]\n" >&2
12 echo "Script to run the shell.\n" >&2
13 echo "OPTIONS:" >&2
14 echo " -f, --fake Force use of fake Qml modules." >&2
15 echo " -p, --pinlock Use a pin protected user." >&2
16 echo " -k, --keylock Use a passphrase protected user." >&2
17 echo " -g, --gdb Run through gdb." >&2
18 echo " -h, --help Show this help." >&2
19 echo " -m, --nomousetouch Run without -mousetouch argument." >&2
20 echo >&2
21 exit 1
24ARGS=`getopt -n$0 -u -a --longoptions="fake,pinlock,keylock,gdb,help,nomousetouch" -o "fpkghm" -- "$@"`
25[ $? -ne 0 ] && usage
26eval set -- "$ARGS"
28while [ $# -gt 0 ]
29do
30 case "$1" in
31 -f|--fake) FAKE=true;;
32 -p|--pinlock) PINLOCK=true;;
33 -k|--keylock) KEYLOCK=true;;
34 -g|--gdb) GDB=true;;
35 -h|--help) usage;;
36 -m|--nomousetouch) MOUSE_TOUCH=false;;
37 --) shift;break;;
38 esac
39 shift
40done
42if $FAKE; then
43 export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
44 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/LightDM/single
45fi
47if $PINLOCK; then
48 export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
49 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/LightDM/single-pin
50fi
52if $KEYLOCK; then
53 export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
54 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/LightDM/single-passphrase
55fi
57# Force icon theme if running on the desktop, otherwise gnome theme (if running
58# on Ubuntu Desktop) will be used and icons won't be found
59if [ -n "$DESKTOP_SESSION" ]; then
60 export UBUNTU_ICON_THEME=ubuntu-mobile
61fi
63QML_PHONE_SHELL_ARGS=""
64if $MOUSE_TOUCH; then
65 QML_PHONE_SHELL_ARGS="$QML_PHONE_SHELL_ARGS -mousetouch"
66fi
68if $GDB; then
69 gdb -ex run --args $QML_PHONE_SHELL_PATH $QML_PHONE_SHELL_ARGS $@
70else
71 $QML_PHONE_SHELL_PATH $QML_PHONE_SHELL_ARGS $@
72fi