summaryrefslogtreecommitdiff
path: root/scripts/generic-wayland.post
blob: 4500b785d01227426e8fae2afa0a5c358eb21445 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#################### generic-wayland.post ##################

# Add 'app' user to the display group
/usr/sbin/groupmod -A app display

# add other users to display group
for user in alice bob carol guest; do
	/usr/sbin/groupmod -A $user display
done

# Enable a logind session for users on seat0 (the default seat for
# graphical sessions)
unitdir=/usr/lib/systemd/system
mkdir -p $unitdir/graphical.target.wants
for user in app alice bob carol guest; do
	uid=$(getent passwd $user|cut -f3 -d':')
	ln -s ../user-session-launch@.service $unitdir/graphical.target.wants/user-session-launch@seat0-$uid.service
done

# user sessions must start after graphical target
patch -p1 -d/ <<'EOF'
--- bad/lib/systemd/system/user-session-launch@.service	2014-04-11 03:51:54.651484824 -0700
+++ good/lib/systemd/system/user-session-launch@.service	2014-04-11 03:44:28.016532732 -0700
@@ -1,9 +1,10 @@
 [Unit]
 Description=User Session Launcher
-After=systemd-user-sessions.service systemd-logind.service
-Requires=systemd-logind.service
+After=systemd-user-sessions.service systemd-logind.service display-manager.service
+Requires=systemd-logind.service display-manager.service
 
 [Service]
-ExecStart=/usr/bin/user-session-launch %i
+ExecStart=/usr/bin/wl-pre "/usr/bin/user-session-launch %i"
 
 [Install]
EOF

# clean weston target inside user session (installed by weston)
rm -f /usr/lib/systemd/user/weston.target