2007-01-07 17:26:05 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
SESSION=
|
|
|
|
|
|
|
|
case "$DESKTOP_SESSION" in
|
|
|
|
kde) SESSION=kde ;;
|
|
|
|
gnome) SESSION=gnome ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ -z "$SESSION" ] ; then
|
|
|
|
WM="${WINDOWMANAGER##*/}"
|
|
|
|
case "$WM" in
|
|
|
|
*kde*) SESSION=kde ;;
|
|
|
|
*gnome*) SESSION=gnome ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$SESSION" ] ; then
|
|
|
|
if [ -n "$KDE_FULL_SESSION" ] ; then
|
|
|
|
SESSION=kde
|
|
|
|
fi
|
|
|
|
if [ -n "$GNOME_DESKTOP_SESSION_ID" ] ; then
|
|
|
|
SESSION=gnome
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-10-11 09:28:34 +02:00
|
|
|
if [ -n "$SSH_AUTH_SOCK" ] ; then
|
|
|
|
# Ensure that ssh can use the ssh support of the gpg-agent
|
|
|
|
case "$SSH_AUTH_SOCK" in
|
|
|
|
*/S.gpg-agent.ssh) gpg-connect-agent /bye < /dev/null ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2013-09-19 06:09:33 +02:00
|
|
|
GNOME_SSH_ASKPASS="@LIBEXECDIR@/ssh/gnome-ssh-askpass"
|
|
|
|
KDE_SSH_ASKPASS="@LIBEXECDIR@/ssh/ksshaskpass"
|
|
|
|
X11_SSH_ASKPASS="@LIBEXECDIR@/ssh/x11-ssh-askpass"
|
2007-01-07 17:26:05 +01:00
|
|
|
|
|
|
|
case "$SESSION" in
|
|
|
|
gnome)
|
|
|
|
if [ -f $GNOME_SSH_ASKPASS ]; then
|
|
|
|
exec $GNOME_SSH_ASKPASS ${1+"$@"}
|
|
|
|
else
|
|
|
|
exec $X11_SSH_ASKPASS ${1+"$@"}
|
|
|
|
fi
|
|
|
|
;;
|
2009-07-09 13:58:30 +02:00
|
|
|
kde)
|
|
|
|
if [ -f $KDE_SSH_ASKPASS ]; then
|
|
|
|
exec $KDE_SSH_ASKPASS ${1+"$@"}
|
|
|
|
else
|
|
|
|
exec $X11_SSH_ASKPASS ${1+"$@"}
|
|
|
|
fi
|
|
|
|
;;
|
2007-01-07 17:26:05 +01:00
|
|
|
*)
|
|
|
|
exec $X11_SSH_ASKPASS ${1+"$@"}
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|