description "Unity Shell v8" author "Ricardo Mendoza " emits indicator-services-start start on ((xsession SESSION=ubuntu-touch) or (xsession SESSION=unity8-mir) or (xsession SESSION=unity8)) and started dbus stop on desktop-end kill timeout 120 # # Ensure the shell always gets unthrottled touch events, so that applications # who want full speed low-latency input can get it (LP: #1497105) and so that # apps can use QML touch compression safely (the QML touch compression # algorithm does not support nesting well - LP: #1486341, LP: #1556763 - so # must be fed by the raw input event stream from Unity8). # env QML_NO_TOUCH_COMPRESSION=1 respawn expect stop # FIXME Create an autopilot test that makes sure start+stop and restart # work fine at least 2 times pre-start script # Tell unity-mir to raise SIGSTOP after we start initctl set-env UNITY_MIR_EMITS_SIGSTOP=1 # Save original value of MIR_SOCKET so that we can restore it when stopped, # as we modify the variable for future jobs, including ourself. initctl set-env UNITY_MIR_SOCKET=$MIR_SOCKET # Decide where we are going to put our own socket file if [ -n "$SNAP" ]; then # In snappy, we want to hard code our path because our apparmor profile # only lets us put the socket in one place. And consumers expect it # there. MIR_SERVER_FILE=/run/user/$(id -u)/mir_socket else MIR_SERVER_FILE=$XDG_RUNTIME_DIR/mir_socket fi initctl set-env MIR_SERVER_FILE=$MIR_SERVER_FILE # Point all future jobs in this session to our Mir socket instead of # unity-system-compositor's socket. initctl set-env --global MIR_SOCKET=$MIR_SERVER_FILE gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "@a{ss} {'MIR_SOCKET': '$MIR_SERVER_FILE'}" # Remove the normal and trusted sockets if still there if [ -S "$MIR_SERVER_FILE" ]; then rm "$MIR_SERVER_FILE" fi if [ -S "${MIR_SERVER_FILE}_trusted" ]; then rm "${MIR_SERVER_FILE}_trusted" fi initctl set-env --global MIR_SERVER_PROMPT_FILE=1 if [ "$XDG_SESSION_DESKTOP" = "ubuntu-touch" ]; then # On Ubuntu Touch, we currently use a trick where we auto-login the # user without a LightDM greeter at all. In this case, we want to # start with the lockscreen visible. Once we switch to using a # proper greeter for the first login, we can remove this code path. initctl set-env MODE=full-greeter else initctl set-env MODE=full-shell fi end script exec ${BINARY:-unity8} --mode=$MODE $ARGS post-start script initctl emit --no-wait indicator-services-start end script post-stop script initctl set-env --global MIR_SOCKET=$UNITY_MIR_SOCKET initctl unset-env --global MIR_SERVER_PROMPT_FILE initctl emit application-end end script