2# -*- Mode: sh; indent-tabs-mode: nil; tab-width: 4 -*-
4# Copyright (C) 2011,2013,2016 Canonical Ltd
6# This program is free software: you can redistribute it and/or modify it under
7# the terms of the GNU General Public License as published by the Free Software
8# Foundation, version 3 of the License.
10# See http://www.gnu.org/copyleft/gpl.html the full text of the license.
12# This wrapper merely ensures that init and friends live only as long as this
13# script does. Otherwise, it's very easy for some processes to not notice that
14# the session died. We could try to do this in-process, but we want to do this
15# cleanup even if the greeter aborts.
22 # Kill upstart and indicators
23 if [ -n "$INIT_PID" ]; then
26 if [ -n "$CMD_PID" ]; then
35 gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "{'$1': '$2'}"
36 if [ -n "$INIT_PID" ]; then
37 initctl set-env --global "$1=$2"
41SUB_SOCKET=$XDG_RUNTIME_DIR/mir_socket
42rm -f $SUB_SOCKET # clear socket in case we were hard shut down
44echo "DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS}" >"$XDG_RUNTIME_DIR/dbus-session"
46# If touch session script (which sets up grid units and mir variables) is available, use it
48if which ubuntu-touch-session >/dev/null; then
49 TOUCH_WRAPPER=ubuntu-touch-session
52# Advertise as a unity8 session, so that indicator-network will start.
53export XDG_SESSION_DESKTOP=unity8
54export DESKTOP_SESSION=$XDG_SESSION_DESKTOP
56set_greeter_var QT_IM_MODULE maliitphablet
57set_greeter_var QT_QPA_PLATFORM ubuntumirclient
59# We disable ofono using pulse. It causes problems with racing with the user's
60# pulse. We need to come up with a better long-term fix for this, because we
61# eventually need the greeter to play ringtones for users that aren't logged in.
62set_greeter_var PA_DISABLED 1
64# Normal unity8 sessions are entirely driven by Upstart. But greeters
65# are special. They need access to the file descriptors that lightdm
66# creates for them and don't want to start all the services that a normal
67# session would. So it's inconvenient to live within an upstart session.
68# But... we still want to use Upstart for some services. So launch here.
69MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER upstart --user --no-startup-event &
71while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
72. "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session"
75# Connect upstart to system, but do first command in a loop to avoid any
76# race condition between the session file above being written and upstart being
77# ready to handle requests.
78while ! initctl notify-dbus-address "$DBUS_SESSION_BUS_ADDRESS"; do sleep 0.1; done
79initctl start notify-cgmanager
81# Start any pre-greeter tasks if needed (like wizard)
82initctl emit unity8-greeter-starting
84# Define language here for phone if available. When phone user switches their
85# language, they expect that to affect the greeter too. But the user doesn't
86# have permission to switch system language, only their own. So we notice if
87# the phablet user exists and use their language if so. TODO: talk to design
88# about whether we should switch language on fly as users are selected (this
89# is very hard to do technically).
91# Do this after unity8-greeter-starting, in case a customization upstart job
93if [ "$(id -u phablet 2>/dev/null)" = "32011" ]; then
94 USER_LANG=$(gdbus call --system --dest org.freedesktop.Accounts --object-path /org/freedesktop/Accounts/User32011 --method org.freedesktop.DBus.Properties.Get org.freedesktop.Accounts.User Language | cut -d\' -f2)
95 if [ -n "$USER_LANG" ]; then
96 set_greeter_var LANGUAGE "$USER_LANG"
98 USER_LOCALE=$(gdbus call --system --dest org.freedesktop.Accounts --object-path /org/freedesktop/Accounts/User32011 --method org.freedesktop.DBus.Properties.Get org.freedesktop.Accounts.User FormatsLocale | cut -d\' -f2)
99 if [ -n "$USER_LOCALE" ]; then
100 set_greeter_var LANG "$USER_LOCALE"
101 set_greeter_var LC_ALL "$USER_LOCALE"
105# And finally actually start the greeter
106exec env MIR_SERVER_FILE=$SUB_SOCKET $TOUCH_WRAPPER $@ &
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list