@@ -30,6 +30,15 @@ cleanup()
3030 exit 0
3131}
3232
33+set_greeter_var()
34+{
35+ export "$1=$2"
36+ gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "{'$1': '$2'}"
37+ if [ -n "$INIT_PID" ]; then
38+ initctl set-env --global "$1=$2"
39+ fi
40+}
41+
3342SUB_SOCKET=$XDG_RUNTIME_DIR/mir_socket
3443rm -f $SUB_SOCKET # clear socket in case we were hard shut down
3544
@@ -46,8 +55,7 @@ export DESKTOP_SESSION=ubuntu-touch
4655# We disable ofono using pulse. It causes problems with racing with the user's
4756# pulse. We need to come up with a better long-term fix for this, because we
4857# eventually need the greeter to play ringtones for users that aren't logged in.
49−export PA_DISABLED=1
50−gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "{'PA_DISABLED': '1'}"
58+set_greeter_var PA_DISABLED 1
5159
5260# Normal unity8 sessions are entirely driven by Upstart. But greeters
5361# are special. They need access to the file descriptors that lightdm
@@ -74,7 +82,12 @@ export UPSTART_SESSION=$(/sbin/initctl list-sessions | grep "^$INIT_PID " | cut
7482if [ "$(id -u phablet 2>/dev/null)" = "32011" ]; then
7583 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)
7684 if [ -n "$USER_LANG" ]; then
77− export LANGUAGE="$USER_LANG"
85+ set_greeter_var LANGUAGE "$USER_LANG"
86+ fi
87+ 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)
88+ if [ -n "$USER_LOCALE" ]; then
89+ set_greeter_var LANG "$USER_LOCALE"
90+ set_greeter_var LC_ALL "$USER_LOCALE"
7891 fi
7992fi
8093