aboutsummaryrefslogtreecommitdiffstats
path: root/sbin/Xsession
blob: a83a953e0b3adbfdbfd5e8afe5fa70feab3cb718 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/bash -login
# (c) 1999 Red Hat Software, Inc.
# Modification for Linux-Mandrake by Chmouel Boudjnah <chmouel@mandraksoft.com>

xsetroot -solid #356390

# redirect errors to a file in user's home directory if we can
for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER"
do
if ( cp /dev/null "$errfile" 2> /dev/null )
then
chmod 600 "$errfile"
exec > "$errfile" 2>&1
break
fi
done

# clean up after xbanner
if [ -f /usr/X11R6/bin/freetemp ]; then
freetemp
fi

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap

# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi

if [ -f $userresources ]; then
xrdb -merge $userresources
fi

if [ -f $usermodmap ]; then
xmodmap $usermodmap
fi

# now, we see if xdm/gdm/kdm has asked for a specific environment
case $# in
1)
case $1 in
KDE)
exec startkde
;;
Gnome)
exec gnome-session
;;
AfterStep)
exec /usr/X11R6/bin/afterstep
;;
AnotherLevel)
# we assume that switchdesk is installed.
exec /usr/share/apps/switchdesk/Xclients.anotherlevel
;;
BlackBox)
exec /usr/X11R6/bin/bbdrake
;;
# Work but some end users don't understant how it works. So, we disable it.
#BlackBox/KDE)
#exec /usr/X11R6/bin/bbdrake_kde
#;;
Enlightenment)
exec /usr/bin/enlightenment
;;
FVWM)
exec /usr/X11R6/bin/fvwm
;;
FVWM2)
exec /usr/X11R6/bin/fvwm2
;;
IceWM)
exec /usr/X11R6/bin/icewm
;;
MWM)
exec /usr/X11R6/mwm
;;
WindowMaker)
[ -f $HOME/GNUstep/Defaults/WindowMaker ] || {
/usr/X11R6/bin/wmaker.inst --batch
}
exec /usr/X11R6/bin/wmaker
;;
XFCE)
exec /usr/X11R6/bin/xfwm
;;
FailSafe)
exec xterm -geometry 80x24-0-0
;;
esac
esac

# otherwise, take default action
if [ -x "$HOME/.xsession" ]; then
exec "$HOME/.xsession"
elif [ -x "$HOME/.Xclients" ]; then
exec "$HOME/.Xclients"
elif [ -x /etc/X11/xinit/Xclients ]; then
exec /etc/X11/xinit/Xclients
else
exec xsm
fi