~cimi/unity8/card_touchdown

« back to all changes in this revision

Viewing changes to data/unity8-greeter-wrapper

  • Committer: Andrea Cimitan
  • Date: 2014-06-24 09:54:02 UTC
  • mfrom: (917.6.36 unity8)
  • Revision ID: andrea.cimitan@gmail.com-20140624095402-gaw0o3l8y9fmoqhz
[ Michał Sawicz ]
* Make so that fixedArtShapeSize actually fixes artShapeSize.
[ Albert Astals ]
* Add VerticalJournal integration to Dash/scopes/QML (LP: #1326467)
* Make so that fixedArtShapeSize actually fixes artShapeSize.
[ Mirco Müller ]
* Added the frontend-part of sound-hint support for notifications with
  updated QML-tests.
* New rebuild forced
[ Albert Astals ]
* Departments support (LP: #1320847)
[ Pawel Stolowski ]
* Extend the hack for click scope categories with the upcoming 'store'
  category: single-tap on results from the 'store' category should
  activate them, instead of requesting a preview. (LP: #1326292)
[ Albert Astals ]
* Drop the " Preview" suffix from Preview title As requested in
  https://bugs.launchpad.net/unity8/+bug/1316671 (LP: #1316671)
[ Michael Terry ]
* Revert split greeter for now.  We will bring it back as an option
  for Desktop, but use a big hammer revert right now to get Touch back
  in shape.
[ CI bot ]
* Fix build problems. Reviewed by: Michael Terry (LP: #1328850)
[ Michał Sawicz ]
* Make lockscreen buttons translatable.
[ Albert Astals ]
* Correctly mark these functions as overrides
* Remove connections to non existant signal
* Better test name
* Improvements for headerless categories LVPWH: No section name -> no
  header LVPWH: New hasSectionHeader context property for delegates
  GSV: Add topMargin if no hasSectionHeader (LP: #1326415)
* Make tryVerticalJournal, tryHorizontalJournal and tryOrganicGrid
  work again
[ Michael Zanetti ]
* Don't crash when we get an invalid app from ApplicationManager (LP:
  #1309162)
[ Andrea Cimitan ]
* Workaround for lp1324159 (LP: #1322233, #1324159)
[ CI bot ]
* Resync trunk
[ Florian Boucault ]
* Application startup: changed splash rectangle to be black instead of
  white and added a neat little animation. (LP: #1124265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# -*- Mode: sh; indent-tabs-mode: nil; tab-width: 4 -*-
3
 
#
4
 
# Copyright (C) 2011,2013 Canonical Ltd
5
 
# Author: Michael Terry <michael.terry@canonical.com>
6
 
#
7
 
# This program is free software: you can redistribute it and/or modify it under
8
 
# the terms of the GNU General Public License as published by the Free Software
9
 
# Foundation, version 3 of the License.
10
 
#
11
 
# See http://www.gnu.org/copyleft/gpl.html the full text of the license.
12
 
 
13
 
# This wrapper merely ensures that init and friends live only as long as this
14
 
# script does.  Otherwise, it's very easy for some processes to not notice that
15
 
# the session died.  We could try to do this in-process, but we want to do this
16
 
# cleanup even if the greeter aborts.
17
 
 
18
 
trap cleanup TERM EXIT
19
 
 
20
 
cleanup()
21
 
{
22
 
    trap - TERM EXIT
23
 
    # Kill upstart and indicators
24
 
    if [ -n "$INIT_PID" ]; then
25
 
        kill "$INIT_PID"
26
 
    fi
27
 
    if [ -n "$DBUS_PID" ]; then
28
 
        kill "$DBUS_PID"
29
 
    fi
30
 
    if [ -n "$CMD_PID" ]; then
31
 
        kill "$CMD_PID"
32
 
    fi
33
 
    exit 0
34
 
}
35
 
 
36
 
set_greeter_var()
37
 
{
38
 
    export "$1=$2"
39
 
    gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment "{'$1': '$2'}"
40
 
    if [ -n "$INIT_PID" ]; then
41
 
        initctl set-env --global "$1=$2"
42
 
    fi
43
 
}
44
 
 
45
 
# Start dbus if it hasn't already been started for us (such as on the Desktop
46
 
# images by dbus-launch).  We don't want to use dbus-launch ourselves because
47
 
# we don't want dbus-x11 on the Touch images.
48
 
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
49
 
    export DBUS_SESSION_BUS_ADDRESS=unix:abstract=$(mktemp -u /tmp/dbus-XXXXXXXXXX)
50
 
    DBUS_PID=$(dbus-daemon --fork --session --print-pid --address="$DBUS_SESSION_BUS_ADDRESS")
51
 
fi
52
 
 
53
 
SUB_SOCKET=$XDG_RUNTIME_DIR/mir_socket
54
 
rm -f $SUB_SOCKET # clear socket in case we were hard shut down
55
 
 
56
 
# If touch session script (which sets up grid units and mir variables) is available, use it
57
 
TOUCH_WRAPPER=
58
 
if [ -x /usr/bin/ubuntu-touch-session ]; then
59
 
    TOUCH_WRAPPER=/usr/bin/ubuntu-touch-session
60
 
fi
61
 
 
62
 
# Pretend that we're in an ubuntu-touch session, so that indicator-network
63
 
# will start.
64
 
export DESKTOP_SESSION=ubuntu-touch
65
 
 
66
 
# We disable ofono using pulse.  It causes problems with racing with the user's
67
 
# pulse.  We need to come up with a better long-term fix for this, because we
68
 
# eventually need the greeter to play ringtones for users that aren't logged in.
69
 
set_greeter_var PA_DISABLED 1
70
 
 
71
 
# Normal unity8 sessions are entirely driven by Upstart.  But greeters
72
 
# are special.  They need access to the file descriptors that lightdm
73
 
# creates for them and don't want to start all the services that a normal
74
 
# session would.  So it's inconvenient to live within an upstart session.
75
 
# But... we still want to use Upstart for some services.  So launch here.
76
 
USC_SOCKET=$MIR_SOCKET MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER /sbin/init --user --no-startup-event &
77
 
INIT_PID=$!
78
 
while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
79
 
export UPSTART_SESSION=$(/sbin/initctl list-sessions | grep "^$INIT_PID " | cut -d' ' -f2)
80
 
 
81
 
# Start any pre-greeter tasks if needed (like wizard)
82
 
/sbin/initctl emit unity8-greeter-starting
83
 
 
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).
90
 
#
91
 
# Do this after unity8-greeter-starting, in case a customization upstart job
92
 
# changes language.
93
 
if [ "$(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"
97
 
    fi
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"
102
 
    fi
103
 
fi
104
 
 
105
 
# And finally actually start the greeter
106
 
exec env MIR_SERVER_FILE=$SUB_SOCKET $TOUCH_WRAPPER $@ &
107
 
CMD_PID=$!
108
 
wait $CMD_PID
109
 
CMD_PID=