Debian Codegraph @

data/Xsession

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
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/xprofile ] && . /etc/xprofile
13 [ -f ~/.xprofile ] && . ~/.xprofile
14
15 if [ -f /etc/X11/xinit/xinitrc-common ]; then
16 # fedora
17 . /etc/X11/xinit/xinitrc-common
18 exec -l bash -c "$LXSESSION"
19 elif [ -x /etc/X11/xinit/Xsession ]; then
20 # fedora
21 exec /etc/X11/xinit/Xsession "$LXSESSION"
22 elif [ -x /etc/X11/Xsession ]; then
23 # mandriva, debian, ubuntu
24 exec /etc/X11/Xsession "$LXSESSION"
25 elif [ -x /etc/X11/xinit/xinitrc ]; then
26 #suse
27 export WINDOWMANAGER=$LXSESSION
28 exec -l bash -c /etc/X11/xinit/xinitrc
29 else
30 # unknown, user should custom /etc/lxdm/xinitrc self
31 if [ -x /etc/lxdm/xinitrc ]; then
32 . /etc/lxdm/xinitrc "$LXSESSION"
33 fi
34 if [ -d /etc/X11/xinit/xinitrc.d ] ; then
35 for f in /etc/X11/xinit/xinitrc.d/* ; do
36 [ -x "$f" ] && . "$f"
37 done
38 unset f
39 fi
40
41 if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS";
42 then
43 eval "$(dbus-launch --sh-syntax --exit-with-session)"
44 fi
45
46 exec -l bash -c "$LXSESSION"
47 fi
48