summaryrefslogtreecommitdiff
path: root/configs/lxde-multi/root-image/etc/lxdm/Xsession
diff options
context:
space:
mode:
Diffstat (limited to 'configs/lxde-multi/root-image/etc/lxdm/Xsession')
-rwxr-xr-xconfigs/lxde-multi/root-image/etc/lxdm/Xsession48
1 files changed, 48 insertions, 0 deletions
diff --git a/configs/lxde-multi/root-image/etc/lxdm/Xsession b/configs/lxde-multi/root-image/etc/lxdm/Xsession
new file mode 100755
index 0000000..ebc2ff7
--- /dev/null
+++ b/configs/lxde-multi/root-image/etc/lxdm/Xsession
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+# use bash for "exec -l", howto run login shell by /bin/sh ?
+
+if [ $# -eq 1 -a -n "$1" ]; then
+ LXSESSION=$1
+else
+# default session
+ LXSESSION=/usr/bin/startlxde
+fi
+
+[ -f /etc/profile ] && . /etc/profile
+[ -f ~/.profile ] && . ~/.profile
+[ -f /etc/xprofile ] && . /etc/xprofile
+[ -f ~/.xprofile ] && . ~/.xprofile
+
+if [ -f /etc/X11/xinit/xinitrc-common ]; then
+# fedora
+ . /etc/X11/xinit/xinitrc-common
+ if ! [ -z "$XDG_SESSION_COOKIE" ]; then
+ CK_XINIT_SESSION=
+ elif [ -x /usr/bin/ck-launch-session -a -z "$CK_XINIT_SESSION" ]; then
+ CK_XINIT_SESSION="/usr/bin/ck-launch-session"
+ fi
+ exec -l $SHELL -c "$CK_XINIT_SESSION \"$LXSESSION\""
+elif [ -x /etc/X11/xinit/Xsession ]; then
+# fedora
+ exec /etc/X11/xinit/Xsession "$LXSESSION"
+elif [ -x /etc/X11/Xsession ]; then
+# mandriva, debian, ubuntu
+ exec /etc/X11/Xsession "$LXSESSION"
+elif [ -x /etc/X11/xinit/xinitrc ]; then
+#suse
+ export WINDOWMANAGER=$LXSESSION
+ exec -l $SHELL -c /etc/X11/xinit/xinitrc
+else
+# unknown, user should custom /etc/lxdm/xinitrc self
+ if [ -x /etc/lxdm/xinitrc ]; then
+ . /etc/lxdm/xinitrc
+ fi
+ if ! [ -z "$XDG_SESSION_COOKIE" ]; then
+ CK_XINIT_SESSION=
+ elif [ -x /usr/bin/ck-launch-session ]; then
+ CK_XINIT_SESSION="/usr/bin/ck-launch-session"
+ fi
+ exec -l $SHELL -c "$CK_XINIT_SESSION \"$LXSESSION\""
+fi
+