on 00a39ec help sign in
unity8/run
74 lines 2.4 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 " -G, --greeter Run the greeter instead of the shell." >&2
19 echo " -h, --help Show this help." >&2
20 echo " -m, --nomousetouch Run without -mousetouch argument." >&2
21 echo >&2
22 exit 1
25ARGS=`getopt -n$0 -u -a --longoptions="fake,pinlock,keylock,gdb,greeter,help,nomousetouch" -o "fpkgGhm" -- "$@"`
26[ $? -ne 0 ] && usage
27eval set -- "$ARGS"
29while [ $# -gt 0 ]
30do
31 case "$1" in
32 -f|--fake) FAKE=true;;
33 -p|--pinlock) PINLOCK=true;;
34 -k|--keylock) KEYLOCK=true;;
35 -g|--gdb) GDB=true;;
36 -G|--greeter) QML_PHONE_SHELL_PATH=./builddir/unity8-greeter;;
37 -h|--help) usage;;
38 -m|--nomousetouch) MOUSE_TOUCH=false;;
39 --) shift;break;;
40 esac
41 shift
42done
44if $FAKE; then
45 export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
46 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/liblightdm/single
47fi
49if $PINLOCK; then
50 export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
51 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/liblightdm/single-pin
52fi
54if $KEYLOCK; then
55 export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
56 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/liblightdm/single-passphrase
57fi
59# Force icon theme if running on the desktop, otherwise gnome theme (if running
60# on Ubuntu Desktop) will be used and icons won't be found
61if [ -n "$DESKTOP_SESSION" ]; then
62 export UBUNTU_ICON_THEME=ubuntu-mobile
63fi
65QML_PHONE_SHELL_ARGS=""
66if $MOUSE_TOUCH; then
67 QML_PHONE_SHELL_ARGS="$QML_PHONE_SHELL_ARGS -mousetouch"
68fi
70if $GDB; then
71 gdb -ex run --args $QML_PHONE_SHELL_PATH $QML_PHONE_SHELL_ARGS $@
72else
73 $QML_PHONE_SHELL_PATH $QML_PHONE_SHELL_ARGS $@
74fi