@@ -0,0 +1,45 @@
1+#!/bin/sh
2+# -*- Mode: sh; indent-tabs-mode: nil; tab-width: 2 -*-
3+
4+# Ensure the shell always gets unthrottled touch events, so that applications
5+# who want full speed low-latency input can get it (LP: #1497105) and so that
6+# apps can use QML touch compression safely (the QML touch compression
7+# algorithm does not support nesting well - LP: #1486341, LP: #1556763 - so
8+# must be fed by the raw input event stream from Unity8).
9+export QML_NO_TOUCH_COMPRESSION=1
10+
11+export MIR_SERVER_PROMPT_FILE=1
12+
13+# Hard code socket path because our snappy apparmor profile
14+# only lets us put the socket in one place. And consumers expect it there.
15+# (XDG_RUNTIME_DIR isn't typical under snappy)
16+export MIR_SERVER_FILE=/run/user/$(id -u)/mir_socket
17+
18+rm -f "$MIR_SERVER_FILE"
19+rm -f "${MIR_SERVER_FILE}_trusted"
20+
21+if [ "$XDG_SESSION_DESKTOP" = "ubuntu-touch" ]; then
22+ # On Ubuntu Touch, we currently use a trick where we auto-login the
23+ # user without a LightDM greeter at all. In this case, we want to
24+ # start with the lockscreen visible. Once we switch to using a
25+ # proper greeter for the first login, we can remove this code path.
26+ MODE=full-greeter
27+else
28+ MODE=full-shell
29+fi
30+
31+dbus-update-activation-environment --systemd MIR_SOCKET=$MIR_SERVER_FILE
32+
33+# Tell unity-mir to raise SIGSTOP after we start, which we use to tell
34+# systemd when we are done starting up.
35+export UNITY_MIR_EMITS_SIGSTOP=1
36+
37+trap 'exit 0' USR1
38+
39+(trap 'kill -CONT $$; kill -USR1 $(jobs -p)' STOP;
40+ exec ${BINARY:-unity8} --mode=$MODE "$@") &
41+
42+#FIXME -- we keep hitting this timeout
43+sleep 30 # timeout for u8 startup (change to 'infinity' to disable timeout)
44+echo "Aborting unity8 launch: didn't hear back from Mir"
45+exit 100