Debian Codegraph @

data/Xsession

raw ◀ ▶
1 Debian patch touch this file
1 #!/bin/bash
2
3 # use bash for "exec -l", howto run login shell by /bin/sh ?
4
5 if [ $# -eq 1 -a -n "$1" ]; then
6 LXSESSION=$1
7 else
8 # default session
9 LXSESSION=/usr/bin/startlxde
10 fi
11
•12 [ -f /etc/profile ] && . /etc/profile
13 [ -f ~/.profile ] && . ~/.profile
14 [ -f /etc/xprofile ] && . /etc/xprofile
15 [ -f ~/.xprofile ] && . ~/.xprofile
16
•17 # override ~/.profile if language was set on the greeter
18 if [ -n "$GREETER_LANGUAGE" ]; then
19 language_list=${GREETER_LANGUAGE%.*}${GREETER_LANGUAGE#*.UTF-8}:en
20 export LANGUAGE="$language_list"
21 export LC_MESSAGES="$GREETER_LANGUAGE"
22 export LC_CTYPE="$GREETER_LANGUAGE"
23 export LC_COLLATE="$GREETER_LANGUAGE"
24 fi
25
26 if [ -f /etc/X11/xinit/xinitrc-common ]; then
27 # fedora
28 . /etc/X11/xinit/xinitrc-common
29 exec -l bash -c "$LXSESSION"
30 elif [ -x /etc/X11/xinit/Xsession ]; then
31 # fedora
32 exec /etc/X11/xinit/Xsession "$LXSESSION"
33 elif [ -x /etc/X11/Xsession ]; then
34 # mandriva, debian, ubuntu
35 exec /etc/X11/Xsession "$LXSESSION"
36 elif [ -x /etc/X11/xinit/xinitrc ]; then
37 #suse
38 export WINDOWMANAGER=$LXSESSION
39 exec -l bash -c /etc/X11/xinit/xinitrc
40 else
41 # unknown, user should custom /etc/lxdm/xinitrc self
42 if [ -x /etc/lxdm/xinitrc ]; then
43 . /etc/lxdm/xinitrc "$LXSESSION"
44 fi
45 if [ -d /etc/X11/xinit/xinitrc.d ] ; then
46 for f in /etc/X11/xinit/xinitrc.d/* ; do
47 [ -x "$f" ] && . "$f"
48 done
49 unset f
50 fi
51
52 if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS";
53 then
54 eval "$(dbus-launch --sh-syntax --exit-with-session)"
55 fi
56
57 exec -l bash -c "$LXSESSION"
58 fi
59