2009-03-19 08:26:42 +00:00
$OpenBSD: patch-config_Xsession_in,v 1.10 2009/03/19 08:26:42 ajacoutot Exp $
--- config/Xsession.in.orig Thu Mar 19 05:59:27 2009
+++ config/Xsession.in Thu Mar 19 09:01:36 2009
2008-12-18 12:06:09 +00:00
@@ -23,6 +23,8 @@
# based on:
# $XConsortium: Xsession /main/10 1995/12/18 18:21:28 gildea $
+PATH=$PATH:${LOCALBASE}/bin
+
command="$@"
# this will go into the .xsession-errors along with all other echo's
2009-03-19 08:26:42 +00:00
@@ -202,6 +204,9 @@ if [ "x$command" = "xdefault" ] ; then
2008-12-18 19:38:26 +00:00
command="/etc/X11/xinit/Xclients"
elif [ -x /etc/X11/Xclients ]; then
command="/etc/X11/Xclients"
+ elif [ -x "/etc/X11/xdm/Xsession" ]; then
+ # Load the OpenBSD default Xsession...
+ command="/etc/X11/xdm/Xsession"
else
if [ -n "$zenity" ] ; then
2007-05-18 17:20:39 +00:00
disptext=`gettextfunc "System has no Xclients file, so starting a failsafe xterm session. Windows will have focus only if the mouse pointer is above them. To get out of this mode type 'exit' in the window."`
2009-03-19 08:26:42 +00:00
@@ -213,12 +218,17 @@ if [ "x$command" = "xdefault" ] ; then
2003-10-08 15:57:01 +00:00
fi
2008-12-18 19:38:26 +00:00
fi
2003-10-08 15:57:01 +00:00
2008-12-18 19:38:26 +00:00
-# add ssh-agent if found
-sshagent="`gdmwhich ssh-agent`"
2003-10-08 15:57:01 +00:00
-if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then
2008-12-18 19:38:26 +00:00
- command="$sshagent -- $command"
-elif [ -z "$sshagent" ] ; then
- echo "$0: ssh-agent not found!"
+# add ssh-agent if found and:
+# * gnome-session is not used (in which case gnome-keyring handles
+# ssh-agent functionality)
+# * OpenBSD default Xsession isn't used (as it already starts ssh-agent)
+if [ "x$command" != "xgnome-session" ] && [ "x$command" != "x/etc/X11/xdm/Xsession" ] ; then
+ sshagent="`gdmwhich ssh-agent`"
+ if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then
+ command="$sshagent -- $command"
+ elif [ -z "$sshagent" ] ; then
+ echo "$0: ssh-agent not found!"
+ fi
fi
echo "$0: Setup done, will execute: $command"