aboutsummaryrefslogtreecommitdiffstats
path: root/bin/fndSession
blob: baf45da8c5846c479bd5d699cabb9782b2a040be (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
# fndSession (c) MandrakeSoft
# Chmouel Boudjnah <chmouel@mandrakesoft.com>

LIST="SessionTypes"

[ -x /usr/bin/kde ] && {
LIST="$LIST=kde"; FIRST=yes
}
[ -x /usr/bin/gnome-session ] && {
	if [ "$FIRST" = "yes" ];then
		LIST="$LIST;gnome"
	else
		LIST="$LIST=gnome"
		FIRST="yes"
	fi
}
[ -e /usr/share/apps/switchdesk/Xclients.anotherlevel ] && {
	if [ "$FIRST" = "yes" ];then
		LIST="$LIST;anotherlevel"
	else
		LIST="$LIST=anotherlevel"
		FIRST="yes"
	fi
}

[ -x /usr/X11R6/bin/wmaker ] && {
	if [ "$FIRST" = "yes" ];then
		LIST="$LIST;WindowMaker"
	else
		LIST="$LIST=WindowMaker"
		FIRST="yes"
	fi
}
[ -x /usr/X11R6/bin/afterstep ] && {
	if [ "$FIRST" = "yes" ];then
		LIST="$LIST;AfterStep"
	else
		LIST="$LIST=AfterStep"
		FIRST="yes"
	fi
}
[ -x /usr/X11R6/bin/icewm ] && {
	if [ "$FIRST" = "yes" ];then
		LIST="$LIST;Icewm"
	else
		LIST="$LIST=Icewm"
		FIRST="yes"
	fi
}
[ -x /usr/bin/xfce ] && {
	if [ "$FIRST" = "yes" ];then
		LIST="$LIST;Xfce"
	else
		LIST="$LIST=Xfce"
		FIRST="yes"
	fi
}

if [ $FIRST = "yes" ];then
	LIST="$LIST;default;failsafe;"
else
	LIST="$LIST=default;failsafe;"
fi
sed "s/^SessionTypes.*/"$LIST"/" /usr/share/config/kdmrc > /tmp/$$.kdmrc && \
mv /tmp/$$.kdmrc /usr/share/config/kdmrc