on 0ec5075 help sign in
unity8/run
91 lines 2.8 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 " -G, --greeter Run the greeter instead of the shell." >&2
22 echo " -h, --help Show this help." >&2
23 echo " -m, --nomousetouch Run without -mousetouch argument." >&2
24 echo >&2
25 exit 1
28ARGS=`getopt -n$0 -u -a --longoptions="fake,pinlock,keylock,gdb,greeter,help,nomousetouch" -o "fpkgGhm" -- "$@"`
29[ $? -ne 0 ] && usage
30eval set -- "$ARGS"
32while [ $# -gt 0 ]
33do
34 case "$1" in
35 -f|--fake) FAKE=true;;
36 -p|--pinlock) PINLOCK=true;;
37 -k|--keylock) KEYLOCK=true;;
38 -g|--gdb) GDB=true;;
39 -G|--greeter) QML_PHONE_SHELL_PATH=./builddir/src/unity8-greeter;;
40 -h|--help) usage;;
41 -m|--nomousetouch) MOUSE_TOUCH=false;;
42 --) shift;break;;
43 esac
44 shift
45done
47if $FAKE; then
48 export QML2_IMPORT_PATH=$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/liblightdm/single
50fi
52if $PINLOCK; then
53 export QML2_IMPORT_PATH=$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/liblightdm/single-pin
55fi
57if $KEYLOCK; then
58 export QML2_IMPORT_PATH=$QML2_IMPORT_PATH:$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
59 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/liblightdm/single-passphrase
60fi
62# Force icon theme if running on the desktop, otherwise gnome theme (if running
63# on Ubuntu Desktop) will be used and icons won't be found
64if [ -n "$DESKTOP_SESSION" ]; then
65 export UBUNTU_ICON_THEME=ubuntu-mobile
66fi
68QML_PHONE_SHELL_ARGS=""
69if $MOUSE_TOUCH; then
70 QML_PHONE_SHELL_ARGS="$QML_PHONE_SHELL_ARGS -mousetouch"
71fi
73control_c()
75 /sbin/initctl stop unity8
76 exit $?
79trap control_c INT
81if $GDB; then
82 gdb -ex run --args $QML_PHONE_SHELL_PATH $QML_PHONE_SHELL_ARGS $@
83else
84 status=`/sbin/initctl status unity8`
85 if [ "$status" != "unity8 stop/waiting" ]; then
86 echo "Unity8 is already running, please stop it first"
87 exit 1
88 fi
89 /sbin/initctl start unity8 BINARY="`readlink -f $QML_PHONE_SHELL_PATH` $QML_PHONE_SHELL_ARGS $@"
90 tailf -n 0 ~/.cache/upstart/unity8.log
91fi