milis/talimatname/genel/lxdm/Xsession

49 lines
1.1 KiB
Plaintext
Raw Normal View History

2016-06-14 21:38:55 +02:00
#!/bin/bash
# use bash for "exec -l", howto run login shell by /bin/sh ?
2017-04-21 00:10:17 +02:00
if [ `which "$1"` ]; then
2016-06-14 21:38:55 +02:00
LXSESSION=$1
else
# default session
2017-04-21 20:12:43 +02:00
LXSESSION=grep -ri "exec" ~/.xinitrc | cut -d' ' -f2
2016-06-14 21:38:55 +02:00
fi
[ -f /etc/profile ] && . /etc/profile
2016-06-14 22:03:42 +02:00
[ -f /etc/bashrc ] && . /etc/bashrc
2016-06-14 21:38:55 +02:00
if [ -f /etc/X11/xinit/xinitrc-common ]; then
# fedora
. /etc/X11/xinit/xinitrc-common
exec -l bash -c "$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 bash -c /etc/X11/xinit/xinitrc
else
# unknown, user should custom /etc/lxdm/xinitrc self
if [ -x /etc/lxdm/xinitrc ]; then
. /etc/lxdm/xinitrc "$LXSESSION"
fi
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/* ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS";
then
eval "$(dbus-launch --sh-syntax --exit-with-session)"
fi
exec -l bash -c "$LXSESSION"
fi