2006-11-25 13:07:29 -07:00
|
|
|
XCOMM!SHELL_CMD
|
|
|
|
XCOMM
|
|
|
|
XCOMM $Xorg: Xsession,v 1.4 2000/08/17 19:54:17 cpqbld Exp $
|
2006-11-28 08:41:12 -07:00
|
|
|
XCOMM $OpenBSD: Xsession.cpp,v 1.2 2006/11/28 15:41:12 matthieu Exp $
|
2006-11-25 13:07:29 -07:00
|
|
|
XCOMM $XFree86: xc/programs/xdm/config/Xsession,v 1.2 1998/01/11 03:48:32 dawes Exp $
|
|
|
|
|
|
|
|
XCOMM redirect errors to a file in user's home directory if we can
|
2006-11-28 08:41:12 -07:00
|
|
|
for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER"
|
|
|
|
do
|
|
|
|
case "$errfile" in
|
|
|
|
"/tmp/*" | "/var/tmp/*")
|
|
|
|
errfile=`mktemp ${errfile}.XXXXXXXXXX` || break;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if ( umask 077 && cp /dev/null "$errfile" 2> /dev/null )
|
|
|
|
then
|
|
|
|
exec > "$errfile" 2>&1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2006-11-25 13:07:29 -07:00
|
|
|
|
2006-11-28 08:41:12 -07:00
|
|
|
XCOMM if we have private ssh key(s), start ssh-agent and add the key(s)
|
|
|
|
id1=$HOME/.ssh/identity
|
|
|
|
id2=$HOME/.ssh/id_dsa
|
|
|
|
id3=$HOME/.ssh/id_rsa
|
|
|
|
if [ -x /usr/bin/ssh-agent ] && [ -f $id1 -o -f $id2 -o -f $id3 ];
|
2006-11-25 13:07:29 -07:00
|
|
|
then
|
2006-11-28 08:41:12 -07:00
|
|
|
eval `ssh-agent -s`
|
|
|
|
ssh-add < /dev/null
|
2006-11-25 13:07:29 -07:00
|
|
|
fi
|
|
|
|
|
2006-11-28 08:41:12 -07:00
|
|
|
do_exit() {
|
|
|
|
if [ "$SSH_AGENT_PID" ]; then
|
|
|
|
ssh-add -D < /dev/null
|
|
|
|
eval `ssh-agent -s -k`
|
|
|
|
fi
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2006-11-25 13:07:29 -07:00
|
|
|
case $# in
|
|
|
|
1)
|
|
|
|
case $1 in
|
|
|
|
failsafe)
|
2006-11-28 08:41:12 -07:00
|
|
|
BINDIR/xterm -geometry 80x24-0-0
|
|
|
|
do_exit
|
2006-11-25 13:07:29 -07:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
|
2006-11-28 08:41:12 -07:00
|
|
|
XCOMM The startup script is not intended to have arguments.
|
2006-11-25 13:07:29 -07:00
|
|
|
|
|
|
|
startup=$HOME/.xsession
|
|
|
|
resources=$HOME/.Xresources
|
|
|
|
|
|
|
|
if [ -s "$startup" ]; then
|
|
|
|
if [ -x "$startup" ]; then
|
2006-11-28 08:41:12 -07:00
|
|
|
"$startup"
|
2006-11-25 13:07:29 -07:00
|
|
|
else
|
2006-11-28 08:41:12 -07:00
|
|
|
/bin/sh "$startup"
|
2006-11-25 13:07:29 -07:00
|
|
|
fi
|
|
|
|
else
|
2006-11-28 08:41:12 -07:00
|
|
|
if [ -f "$resources" ]; then
|
2006-11-25 13:07:29 -07:00
|
|
|
BINDIR/xrdb -load "$resources"
|
|
|
|
fi
|
|
|
|
#if defined(__SCO__) || defined(__UNIXWARE__)
|
|
|
|
[ -r /etc/default/xdesktops ] && {
|
|
|
|
. /etc/default/xdesktops
|
|
|
|
}
|
|
|
|
|
|
|
|
[ -r /etc/default/xdm ] && {
|
|
|
|
. /etc/default/xdm
|
|
|
|
}
|
|
|
|
|
|
|
|
XCOMM Allow the user to over-ride the system default desktop
|
|
|
|
[ -r $HOME/.xdmdesktop ] && {
|
|
|
|
. $HOME/.xdmdesktop
|
|
|
|
}
|
|
|
|
|
|
|
|
[ -n "$XDESKTOP" ] && {
|
|
|
|
exec `eval $XDESKTOP`
|
|
|
|
}
|
|
|
|
#endif
|
2006-11-28 08:41:12 -07:00
|
|
|
BINDIR/xterm &
|
|
|
|
BINDIR/fvwm
|
2006-11-25 13:07:29 -07:00
|
|
|
fi
|