start on XSESSIONS_STARTING
stop on stopped hal
#stop on stopped dbus
respawn
respawn limit 15 3

script

	# should probably be using run-standalone.sh instead of this hack,
	# but if it works don't fix it :)

	## get dbus session bus address
	sleep 2
	PATH="/bin/:/usr/bin"
	pids=`pgrep dbus-daemon`
	for pid in $pids; do
        FILE=`cat /proc/$pid/environ | perl -pe 's/\x0/\n/g'|grep SESSION_BUS_ADDRESS_FILE \
       		|sed -e 's/SESSION_BUS_ADDRESS_FILE=//g'`
	done
	eval `cat $FILE`

	export DISPLAY=:0.0
	exec su user -c "exec /usr/sbin/shortcutd"
	sleep 5

end script
