on xenial help sign in
More $SNAP fixes
cd839cfMichael Terry
data/unity8-dash.conf+1−1
@@ -22,4 +22,4 @@ pre-start script
22 initctl emit scope-ui-starting
22 initctl emit scope-ui-starting
23end script
23end script
24
24
25−exec ${BINARY:-unity8-dash} $ARGS --desktop_file_hint=/usr/share/applications/unity8-dash.desktop
25+exec ${BINARY:-unity8-dash} $ARGS --desktop_file_hint=unity8-dash.desktop
data/unity8-filewatcher.conf+5
@@ -1,6 +1,11 @@
1description "File system watcher for unity8"
1description "File system watcher for unity8"
2author "Michael Zanetti <michael.zanetti@canonical.com>"
2author "Michael Zanetti <michael.zanetti@canonical.com>"
3
3
4+# This method of updating the launcher will not work in our new snappy world,
5+# neither for snaps installed in the system nor if we are running inside a snap.
6+# Plus it hardcodes the phablet user... To be replaced once bug 1630997 is
7+# fixed in ubuntu-app-launch.
8+
4# Workaround for bug 1360208. ~ and * in one expression doesn't work currently
9# Workaround for bug 1360208. ~ and * in one expression doesn't work currently
5start on (file FILE=/home/phablet/.local/share/applications/*.desktop) or (file FILE=/usr/share/applications/*.desktop)
10start on (file FILE=/home/phablet/.local/share/applications/*.desktop) or (file FILE=/usr/share/applications/*.desktop)
6
11
data/unity8-greeter-wrapper+6−6
@@ -45,8 +45,8 @@ echo "DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS}" >"$XDG_RUNTIME_DIR/d
45
45
46# If touch session script (which sets up grid units and mir variables) is available, use it
46# If touch session script (which sets up grid units and mir variables) is available, use it
47TOUCH_WRAPPER=
47TOUCH_WRAPPER=
48−if [ -x /usr/bin/ubuntu-touch-session ]; then
48+if which ubuntu-touch-session >/dev/null; then
49− TOUCH_WRAPPER=/usr/bin/ubuntu-touch-session
49+ TOUCH_WRAPPER=ubuntu-touch-session
50fi
50fi
51
51
52# Pretend that we're in an ubuntu-touch session, so that indicator-network
52# Pretend that we're in an ubuntu-touch session, so that indicator-network
@@ -63,7 +63,7 @@ set_greeter_var PA_DISABLED 1
63# creates for them and don't want to start all the services that a normal
63# creates for them and don't want to start all the services that a normal
64# session would. So it's inconvenient to live within an upstart session.
64# session would. So it's inconvenient to live within an upstart session.
65# But... we still want to use Upstart for some services. So launch here.
65# But... we still want to use Upstart for some services. So launch here.
66−MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER /sbin/upstart --user --no-startup-event &
66+MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER upstart --user --no-startup-event &
67INIT_PID=$!
67INIT_PID=$!
68while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
68while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
69. "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session"
69. "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session"
@@ -72,11 +72,11 @@ export UPSTART_SESSION
72# Connect upstart to system, but do first command in a loop to avoid any
72# Connect upstart to system, but do first command in a loop to avoid any
73# race condition between the session file above being written and upstart being
73# race condition between the session file above being written and upstart being
74# ready to handle requests.
74# ready to handle requests.
75−while ! /sbin/initctl notify-dbus-address "$DBUS_SESSION_BUS_ADDRESS"; do sleep 0.1; done
75+while ! initctl notify-dbus-address "$DBUS_SESSION_BUS_ADDRESS"; do sleep 0.1; done
76−/sbin/initctl start notify-cgmanager
76+initctl start notify-cgmanager
77
77
78# Start any pre-greeter tasks if needed (like wizard)
78# Start any pre-greeter tasks if needed (like wizard)
79−/sbin/initctl emit unity8-greeter-starting
79+initctl emit unity8-greeter-starting
80
80
81# Define language here for phone if available. When phone user switches their
81# Define language here for phone if available. When phone user switches their
82# language, they expect that to affect the greeter too. But the user doesn't
82# language, they expect that to affect the greeter too. But the user doesn't
plugins/LightDM/SessionsModel.cpp+8
@@ -119,6 +119,14 @@ SessionsModel::SessionsModel(QObject* parent)
119 m_roleNames = m_model->roleNames();
119 m_roleNames = m_model->roleNames();
120 m_roleNames[IconRole] = "icon_url";
120 m_roleNames[IconRole] = "icon_url";
121
121
122+ // Update search locations to use $SNAP prefix if specified
123+ auto snapRoot = QFile::decodeName(qgetenv("SNAP"));
124+ if (!snapRoot.isEmpty()) {
125+ for (int i = 0; i < m_iconSearchDirectories.size(); i++) {
126+ m_iconSearchDirectories[i] = snapRoot + m_iconSearchDirectories[i];
127+ }
128+ }
129+
122 setModel(m_model);
130 setModel(m_model);
123 setSourceModel(m_model);
131 setSourceModel(m_model);
124 setSortCaseSensitivity(Qt::CaseInsensitive);
132 setSortCaseSensitivity(Qt::CaseInsensitive);
plugins/Utils/constants.cpp+3
@@ -24,4 +24,7 @@ Constants::Constants(QObject *parent)
24 } else {
24 } else {
25 m_indicatorValueTimeout = 5000;
25 m_indicatorValueTimeout = 5000;
26 }
26 }
27+
28+ QString snapRoot = QFile::decodeName(qgetenv("SNAP"));
29+ m_defaultWallpaper = snapRoot + "/usr/share/backgrounds/warty-final-ubuntu.png";
27}
30}
plugins/Utils/constants.h+3
@@ -30,14 +30,17 @@ class Constants: public QObject
30{
30{
31 Q_OBJECT
31 Q_OBJECT
32 Q_PROPERTY(int indicatorValueTimeout READ indicatorValueTimeout CONSTANT)
32 Q_PROPERTY(int indicatorValueTimeout READ indicatorValueTimeout CONSTANT)
33+ Q_PROPERTY(QString defaultWallpaper READ defaultWallpaper CONSTANT)
33
34
34public:
35public:
35 Constants(QObject *parent = 0);
36 Constants(QObject *parent = 0);
36
37
37 int indicatorValueTimeout() const { return m_indicatorValueTimeout; }
38 int indicatorValueTimeout() const { return m_indicatorValueTimeout; }
39+ QString defaultWallpaper() const { return m_defaultWallpaper; }
38
40
39private:
41private:
40 int m_indicatorValueTimeout;
42 int m_indicatorValueTimeout;
43+ QString m_defaultWallpaper;
41};
44};
42
45
43#endif
46#endif
qml/Shell.qml+1−1
@@ -148,7 +148,7 @@ StyledItem {
148 id: wallpaperResolver
148 id: wallpaperResolver
149 objectName: "wallpaperResolver"
149 objectName: "wallpaperResolver"
150
150
151− readonly property url defaultBackground: "file:///usr/share/backgrounds/warty-final-ubuntu.png"
151+ readonly property url defaultBackground: "file://" + Utils.Constants.defaultBackground
152 readonly property bool hasCustomBackground: background != defaultBackground
152 readonly property bool hasCustomBackground: background != defaultBackground
153
153
154 // Use a cached version of the scaled-down wallpaper (as sometimes the
154 // Use a cached version of the scaled-down wallpaper (as sometimes the