summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2003-06-10 23:02:01 +0000
committerGeorge Lebl <jirka@src.gnome.org>2003-06-10 23:02:01 +0000
commitc14a6887ecc84e2a532c939bacbe34152060ebf4 (patch)
treefdd3c9d04766a4e8f403d2c441af8a37d459b641
parentfcba9ecfca40147cdef8c9a792e4fd127b3d62f7 (diff)
downloadgdm-c14a6887ecc84e2a532c939bacbe34152060ebf4.tar.gz
Change the argument to the Xsession to be the Exec= line of the .desktop
Tue Jun 10 15:57:39 2003 George Lebl <jirka@5z.com> * daemon/slave.c, config/Xsession.in: Change the argument to the Xsession to be the Exec= line of the .desktop and not the .desktop, that was kind of silly in retrospect. We still pass the desktop, but it's kind of secret since I don't want people to depend on this second argument. Also update the comments inside the Xsession to reflect what's really going on.
-rw-r--r--ChangeLog9
-rw-r--r--NEWS6
-rwxr-xr-xconfig/Xsession.in43
-rw-r--r--daemon/slave.c3
4 files changed, 40 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a875f77..db401e29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Tue Jun 10 15:57:39 2003 George Lebl <jirka@5z.com>
+
+ * daemon/slave.c, config/Xsession.in: Change the argument to the
+ Xsession to be the Exec= line of the .desktop and not the .desktop,
+ that was kind of silly in retrospect. We still pass the desktop,
+ but it's kind of secret since I don't want people to depend on this
+ second argument. Also update the comments inside the Xsession
+ to reflect what's really going on.
+
Tue Jun 10 09:59:44 2003 George Lebl <jirka@5z.com>
* configure.in: remove removed files from the generated files list
diff --git a/NEWS b/NEWS
index 6871098f..75eb653d 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@ Ahh news...
2.4.2.x stuff:
+- Completely new session setup, born out of discussions with Oswald
+ Buddenhagen, the KDM maintainer, which will bring about common session
+ setup for both GDM and KDM. We now basically have a common
+ /etc/X11/dm/Sessions directory where there are .desktop files are stored
+ which describe sessions and these will be shared among KDM and GDM.
+
- The greeter.dtd is updated and there is theme creation documentation
(Brian Cameron, Aidan Butler, me)
diff --git a/config/Xsession.in b/config/Xsession.in
index a2226816..02d870f7 100755
--- a/config/Xsession.in
+++ b/config/Xsession.in
@@ -1,17 +1,20 @@
#!/bin/sh
#
-# Note that this is SORT OF LIKE an X session, but not quite. You get a
-# .desktop file as the first argument. You must here then parse the
-# Exec= line out of this file and use that.
-# As a special case, the Exec line can be:
+# This is SORT OF LIKE an X session, but not quite. You get a command as the
+# first argument (it could be multiple words, so run it with "eval"). As a
+# special case, the command can be:
# failsafe - Run an xterm only
-# Xclients - Run the appropriate Xclients startup (see the code below)
+# default - Run the appropriate Xclients startup (see the code below)
+# custom - Run ~/.xsession and if that's not available run 'default'
#
-# You should also handle an argument of 'failsafe'
+# (Note that other arguments could also follow, but only the command one is
+# right now relevant and supported)
#
-# Note that output is ALREADY redirected to .xsession-errors in GDM. This way
+# The output is ALREADY redirected to .xsession-errors in GDM. This way
# .xsession-errors actually gets more output such as if the PreSession script
-# is failing. We wish to be robust don't we?
+# is failing. We wish to be robust don't we? In case you wish to use an
+# existing script for other DM's, you can just not redirect when GDMSESSION
+# is set. GDMSESSION will always be set from gdm.
#
# Also note that this is not run as a login shell, this is just executed.
# This is why we source the profile files below.
@@ -19,6 +22,10 @@
# based on:
# $XConsortium: Xsession /main/10 1995/12/18 18:21:28 gildea $
+# this will go into the .xsession-errors along with all other echo's
+# good for debugging where things went wrong
+echo "Xsession: Beginning session setup..."
+
# First read /etc/profile and .profile
test -f /etc/profile && . /etc/profile
test -f $HOME/.profile && . $HOME/.profile
@@ -28,13 +35,7 @@ test -f $HOME/.xprofile && . $HOME/.xprofile
zenity=`which zenity`
-command=
-if [ -z "$1" ] || [ x"$1" = xfailsafe ] ; then
- command=failsafe
-else
- # Here we parse the .desktop file
- command=`grep 'Exec=' "$1" | sed 's/^Exec=//'`
-fi
+command="$1"
if [ -z "$command" ] ; then
command=failsafe
@@ -165,7 +166,7 @@ if [ "x$command" = "xcustom" ] ; then
if [ -x "$HOME/.xsession" ]; then
command="$HOME/.xsession"
else
- echo "Cannot find ~/.xsession will try the default session"
+ echo "Xsession: Cannot find ~/.xsession will try the default session"
command="default"
fi
fi
@@ -178,9 +179,9 @@ if [ "x$command" = "xdefault" ] ; then
elif [ -x /etc/X11/Xclients ]; then
command="/etc/X11/Xclients"
else
- echo "Cannot find Xclients"
+ echo "Xsession: Cannot find Xclients"
# FIXME: kind of an evil failsafe
- command=xsm
+ command="xsm"
fi
fi
@@ -190,9 +191,11 @@ if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then
command="$sshagent -- $command"
fi
-exec $command
+echo "Xsession: Setup done, will execute: $command"
+
+eval exec $command
-echo "Executing: $command failed, will run xterm"
+echo "Xsession: Executing $command failed, will run xterm"
if [ -n "$zenity" ] ; then
$zenity --info --text "I could not start your session and so I have started the failsafe xterm session. Windows now have focus only if you have your cursor above them. To get out of this mode type \"exit\" in the window in the upper left corner"
diff --git a/daemon/slave.c b/daemon/slave.c
index 1e96d8b1..934e187d 100644
--- a/daemon/slave.c
+++ b/daemon/slave.c
@@ -2563,8 +2563,9 @@ session_child_run (struct passwd *pwent,
we really DON'T care about leaks, we are going to
exec in just a bit */
sessexec = g_strdup_printf
- ("%s %s/%s",
+ ("%s %s %s/%s",
g_shell_quote (GdmXsession),
+ g_shell_quote (exec),
g_shell_quote (GdmSessDir),
g_shell_quote (session));
}