aboutsummaryrefslogtreecommitdiffstats
path: root/prefdm
blob: 0b2d858239041158c32384babd3696239d829ab6 (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
#!/bin/sh

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin

# Run preferred X display manager
preferred=
if [ -f /etc/sysconfig/desktop ]; then
	if grep -q GNOME /etc/sysconfig/desktop 2>/dev/null; then
		preferred=gdm
	elif grep -q KDE /etc/sysconfig/desktop 2> /dev/null; then
		preferred=kdm
	elif grep -q AnotherLevel /etc/sysconfig/desktop 2> /dev/null; then
                preferred=xdm
	fi
fi
if [ -z "$preferred" ]; then
	if which gdm >/dev/null 2>&1; then
		preferred=gdm
	elif which kdm >/dev/null 2>&1; then
		preferred=kdm
	elif which xdm >/dev/null 2>&1; then
		preferred=xdm
	fi
fi
if [ -n "$preferred" ] && which $preferred ; then 
	exec `which $preferred` $*
fi
exit 1