diff options
| -rw-r--r-- | tdm/kfrontend/gentdmconf.c | 54 |
1 files changed, 50 insertions, 4 deletions
diff --git a/tdm/kfrontend/gentdmconf.c b/tdm/kfrontend/gentdmconf.c index 0576eef56..e4f907693 100644 --- a/tdm/kfrontend/gentdmconf.c +++ b/tdm/kfrontend/gentdmconf.c @@ -632,8 +632,6 @@ static const char def_session1[] = "#! /bin/sh\n" "# Xsession - run as user\n" "\n" -"session=$1\n" -"\n" "# Note that the respective logout scripts are not sourced.\n" "case $SHELL in\n" " */bash)\n" @@ -675,8 +673,56 @@ static const char def_session2[] = " [ -f $HOME/.profile ] && . $HOME/.profile\n" " ;;\n" "esac\n" -"# invoke global X session script\n" -". /etc/X11/Xsession\n"; +"\n" +"# source system & user xprofiles\n" +"[ -f /etc/xprofile ] && . /etc/xprofile\n" +"[ -f $HOME/.xprofile ] && . $HOME/.xprofile\n" +"\n" +"# run system xinitrc shell scripts\n" +"if [ -d /etc/X11/xinit/xinitrc.d ]; then\n" +" for i in /etc/X11/xinit/xinitrc.d/* ; do\n" +" [ -x \"$i\" ] && . \"$i\"\n" +" done\n" +"fi\n" +"\n" +"# if the system Xsession startup script is present use it\n" +"if [ -x /etc/X11/Xsession ]; then\n" +" exec /etc/X11/Xsession \"$@\"\n" +"else # otherwice fallback to running the session manually\n" +" # apply Xresources configs\n" +" if type xrdb >/dev/null 2>&1; then\n" +" if [ -d /etc/X11/Xresources ]; then\n" +" for i in /etc/X11/Xresources/*; do\n" +" [ -f \"$i\" ] && xrdb -merge \"$i\"\n" +" done\n" +" elif [ -f /etc/X11/Xresources ]; then\n" +" xrdb -merge /etc/X11/Xresources\n" +" fi\n" +" [ -f $HOME/.Xresources ] && xrdb -merge $HOME/.Xresources\n" +" fi\n" +" \n" +" session=$1\n" +"\n" +" case \"$session\" in\n" +" \"\")\n" +" exec xmessage -center -buttons OK:0 -default OK \"Sorry, \\\"$DESKTOP_SESSION\\\" is not a valid session.\"\n" +" ;;\n" +" failsafe)\n" +" exec xterm -geometry 80x24-0-0\n" +" ;;\n" +" custom)\n" +" exec ${SHELL:-/bin/sh} $HOME/.xsession\n" +" ;;\n" +" default)\n" +" exec " KDE_BINDIR "/starttde\n" +" ;;\n" +" *)\n" +" eval exec \"$session\"\n" +" ;;\n" +" esac\n" +"fi\n" +"\n" +"exec xmessage -center -buttons OK:0 -default OK \"Sorry, cannot execute $session. Check $DESKTOP_SESSION.desktop.\"\n"; static const char def_background[] = "[Desktop0]\n" |
