on 9a87f39 help sign in
unity8/data/unity8.conf
98 lines 3.6 kB history raw
1description "Unity Shell v8"
2author "Ricardo Mendoza <ricmm@ubuntu.com>"
4emits indicator-services-start
6start on ((xsession SESSION=ubuntu-touch) or (xsession SESSION=unity8-mir) or (xsession SESSION=unity8)) and started dbus
7stop on desktop-end
9kill timeout 120
12# Ensure the shell always gets unthrottled touch events, so that applications
13# who want full speed low-latency input can get it (LP: #1497105) and so that
14# apps can use QML touch compression safely (the QML touch compression
15# algorithm does not support nesting well - LP: #1486341, LP: #1556763 - so
16# must be fed by the raw input event stream from Unity8).
18env QML_NO_TOUCH_COMPRESSION=1
20respawn
21expect stop
23pre-start script
24 # Tell unity-mir to raise SIGSTOP after we start
25 initctl set-env UNITY_MIR_EMITS_SIGSTOP=1
27 if [ -n "$MIR_SOCKET" ]; then
28 # FIXME Create an autopilot test that makes sure start+stop and restart
29 # work fine at least 2 times
30 # Save original value of MIR_SOCKET in case we are stopped,
31 # as we modify the variable for future jobs, including ourself.
32 UNITY_MIR_SOCKET=$(initctl get-env --global MIR_SOCKET)
33 initctl set-env --global UNITY_MIR_SOCKET=$UNITY_MIR_SOCKET
35 # Point unity8 at unity-system-compositor
36 MIR_SERVER_FILE=$XDG_RUNTIME_DIR/mir_socket
37 initctl set-env MIR_SERVER_FILE=$MIR_SERVER_FILE
38 initctl set-env MIR_SERVER_HOST_SOCKET=$UNITY_MIR_SOCKET
40 # Point all future jobs in this session to our Mir socket instead of
41 # unity-system-compositor's socket.
42 initctl set-env --global MIR_SOCKET=$MIR_SERVER_FILE
43 gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'MIR_SOCKET': '$MIR_SERVER_FILE'}"
44 fi
46 # Remove the normal and trusted sockets if still there
47 if [ -S "$MIR_SERVER_FILE" ]; then
48 rm "$MIR_SERVER_FILE"
49 fi
51 if [ -S "${MIR_SERVER_FILE}_trusted" ]; then
52 rm "${MIR_SERVER_FILE}_trusted"
53 fi
55 initctl set-env --global MIR_SERVER_PROMPT_FILE=1
57 #
58 # Mir's input resampling is deprecated and going away soon. Turn it off
59 # so we don't get a surprise change in behaviour when that happens.
60 #
61 initctl set-env --global MIR_CLIENT_INPUT_RATE=0
63 if [ "$XDG_SESSION_DESKTOP" = "ubuntu-touch" ]; then
64 # On Ubuntu Touch, we currently use a trick where we auto-login the
65 # user without a LightDM greeter at all. In this case, we want to
66 # start with the lockscreen visible. Once we switch to using a
67 # proper greeter for the first login, we can remove this code path.
68 initctl set-env MODE=full-greeter
69 else
70 initctl set-env MODE=full-shell
71 fi
72end script
74exec ${BINARY:-unity8} --mode=$MODE $ARGS
76post-start script
77 # If no MIR_SOCKET was defined on launch, we try to set one here
78 if [ -z "$(initctl get-env --global UNITY_MIR_SOCKET)" ]; then
79 if [ -S "$XDG_RUNTIME_DIR/mir_socket" ]; then
80 mir_socket=$XDG_RUNTIME_DIR/mir_socket
81 elif [ -S "/tmp/mir_socket" ]; then
82 mir_socket=/tmp/mir_socket
83 fi
85 if [ -n "$mir_socket" ]; then
86 initctl set-env --global MIR_SOCKET="$mir_socket"
87 fi
88 fi
90 initctl emit --no-wait indicator-services-start
91end script
93post-stop script
94 initctl set-env --global MIR_SOCKET=$UNITY_MIR_SOCKET
95 initctl unset-env --global UNITY_MIR_SOCKET
96 initctl unset-env --global MIR_SERVER_PROMPT_FILE
97 initctl emit application-end
98end script