description "Unity Shell v8" author "Ricardo Mendoza " emits indicator-services-start start on ((xsession SESSION=ubuntu-touch) or (xsession SESSION=unity8-mir)) and started dbus stop on desktop-end kill timeout 120 respawn expect stop pre-start script # Tell unity-mir to raise SIGSTOP after we start initctl set-env UNITY_MIR_EMITS_SIGSTOP=1 if [ -n "$MIR_SOCKET" ]; then if [ -z "$UNITY_MIR_SOCKET" ]; then # Save original value of MIR_SOCKET in case we are restarted, # as we modify the variable for future jobs, including ourself. UNITY_MIR_SOCKET=$MIR_SOCKET initctl set-env --global UNITY_MIR_SOCKET=$UNITY_MIR_SOCKET fi # Point unity8 at unity-system-compositor MIR_SERVER_FILE=$XDG_RUNTIME_DIR/mir_socket initctl set-env MIR_SERVER_FILE=$MIR_SERVER_FILE initctl set-env MIR_SERVER_HOST_SOCKET=$UNITY_MIR_SOCKET # 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'}" fi # Remove the socket if still there if [ -S "$MIR_SERVER_FILE" ]; then rm "$MIR_SERVER_FILE" fi initctl set-env --global MIR_SERVER_PROMPT_FILE=1 initctl emit --no-wait indicator-services-start end script exec ${BINARY:-unity8} $ARGS post-stop script initctl set-env --global MIR_SOCKET=$UNITY_MIR_SOCKET initctl unset-env --global UNITY_MIR_SOCKET initctl unset-env --global MIR_SERVER_PROMPT_FILE end script