~mterry/unity8/split

1 by Michał Sawicz
Inital unity8 commit.
1
#!/bin/sh
2
3
QML_PHONE_SHELL_PATH=./builddir/unity8
4
GDB=false
5
FAKE=false
2.2.1 by Michał Sawicz
Add Lockscreens
6
PINLOCK=false
7
KEYLOCK=false
1 by Michał Sawicz
Inital unity8 commit.
8
MOUSE_TOUCH=true
9
10
usage() {
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
2.2.1 by Michał Sawicz
Add Lockscreens
15
    echo " -p, --pinlock Use a pin protected user." >&2
16
    echo " -k, --keylock Use a passphrase protected user." >&2
1 by Michał Sawicz
Inital unity8 commit.
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
22
}
23
2.2.1 by Michał Sawicz
Add Lockscreens
24
ARGS=`getopt -n$0 -u -a --longoptions="fake,pinlock,keylock,gdb,help,nomousetouch" -o "fpkghm" -- "$@"`
1 by Michał Sawicz
Inital unity8 commit.
25
[ $? -ne 0 ] && usage
26
eval set -- "$ARGS"
27
28
while [ $# -gt 0 ]
29
do
30
    case "$1" in
31
       -f|--fake)  FAKE=true;;
2.2.1 by Michał Sawicz
Add Lockscreens
32
       -p|--pinlock)  PINLOCK=true;;
33
       -k|--keylock)  KEYLOCK=true;;
1 by Michał Sawicz
Inital unity8 commit.
34
       -g|--gdb)   GDB=true;;
35
       -h|--help)  usage;;
36
       -m|--nomousetouch)  MOUSE_TOUCH=false;;
37
       --)         shift;break;;
38
    esac
39
    shift
40
done
41
42
if $FAKE; then
2.5.24 by Nick Dedekind
moved IndicatorsClient to modules. Fixed debian/control&install for indicators-client
43
  export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
19.3.1 by Michael Terry
Use libusermetrics; consolidate test usage of that library into a single mock
44
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/LightDM/single
1 by Michał Sawicz
Inital unity8 commit.
45
fi
46
2.2.1 by Michał Sawicz
Add Lockscreens
47
if $PINLOCK; then
2.5.86 by Nick Dedekind
Merged with trunk
48
  export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
19.3.1 by Michael Terry
Use libusermetrics; consolidate test usage of that library into a single mock
49
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/LightDM/single-pin
2.2.1 by Michał Sawicz
Add Lockscreens
50
fi
51
52
if $KEYLOCK; then
2.5.86 by Nick Dedekind
Merged with trunk
53
  export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins:$PWD/builddir/modules
19.3.1 by Michael Terry
Use libusermetrics; consolidate test usage of that library into a single mock
54
  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/libusermetrics:$PWD/builddir/tests/mocks/LightDM/single-passphrase
2.2.1 by Michał Sawicz
Add Lockscreens
55
fi
56
1 by Michał Sawicz
Inital unity8 commit.
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
59
if [ -n "$DESKTOP_SESSION" ]; then
138.238.13 by Michal Hruby
Revert icon theme modification
60
  export UBUNTU_ICON_THEME=ubuntu-mobile
1 by Michał Sawicz
Inital unity8 commit.
61
fi
62
63
QML_PHONE_SHELL_ARGS=""
64
if $MOUSE_TOUCH; then
65
  QML_PHONE_SHELL_ARGS="$QML_PHONE_SHELL_ARGS -mousetouch"
66
fi
67
68
if $GDB; then
69
  gdb -ex run --args $QML_PHONE_SHELL_PATH $QML_PHONE_SHELL_ARGS $@
70
else
71
  $QML_PHONE_SHELL_PATH $QML_PHONE_SHELL_ARGS $@
72
fi