aboutsummaryrefslogtreecommitdiff
path: root/data/unity-greeter-session-broadcast-session.conf
blob: 675bbc2b24934e3f0e9586e91d9a794be2ce4bfe (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
description "Unity Greeter Session Broadcast Session Component"
author "Ted Gould <ted@canonical.com>"

task

emits application-start

#TODO: Check GSettings Key
start on dbus BUS=system SIGNAL="StartApplication" INTERFACE="com.canonical.Unity.Greeter.Broadcast" OBJPATH="/com/canonical/Unity/Greeter/Broadcast"

pre-start script
	if [ -z $ARG0 ] ; then
		stop
		exit 1
	fi
	if [ $ARG0 != $USER ] ; then
		stop
		exit 1
	fi

	OWNER=`gdbus call --system --dest org.freedesktop.DBus --object-path / --method org.freedesktop.DBus.GetNameOwner com.canonical.Unity.Greeter.Broadcast | cut -d "'" -f 2`

	if [ -z $OWNER ] ; then
		stop
		exit 1
	fi
	if [ $OWNER != $SENDER ] ; then
		stop
		exit 1
	fi
end script

exec initctl emit application-start APP_ID=${ARG1}