summaryrefslogtreecommitdiff
path: root/app-misc/sabayon-mce/files/1.1/init.d/sabayon-mce
blob: 0dba609b9d2f8dc00097c3fe4a262d20653eb5f0 (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
#!/sbin/runscript
# Copyright 2012 Sabayon

depend() {
	# In this way autologin settings are overwritten
	after mtab sabayonlive
	before xdm
	need net
}

start() {

	SABAYON_USER="sabayonmce"
	source /sbin/rogentos-functions.sh

	if sabayon_is_mce; then

		ebegin "Sabayon Media Center mode enabled"

		# setup default .dmrc
		echo "[Desktop]" > /var/sabayonmce/.dmrc
		echo "Session=sabayon-mce" >> /var/sabayonmce/.dmrc
		chown sabayonmce /var/sabayonmce/.dmrc
		if [ -x "/usr/libexec/gdm-set-default-session" ]; then
			# oh my fucking glorious god, this
			# is AccountsService bullshit
			# cross fingers
			/usr/libexec/gdm-set-default-session sabayon-mce
		fi

		sabayon_setup_autologin

	elif ! sabayon_is_live && ! sabayon_is_mce; then
		ebegin "Sabayon Media Center mode disabled"
		sabayon_disable_autologin
	fi

	eend 0

}