#!/bin/sh
#
# @(#)$KimmoSuominen: .cfg/home/dot.xsession,v 3.27 2024/02/26 11:20:07 kim Exp $
#
# So, now you're going to have a session started by xdm or similar.
# The way I figured it out, it is better to just try fixing things
# here until you can use your (perhaps more) "usual" ~/.xinitrc, as
# you would with xinit.
#
# This is some crap you might want to get rid of.  But as you see,
# this won't hurt, if your administrator has already fixed these
# variables for you.  I just need to have a default value for each
# and every one of them to feel better using them in other places.
#

umask 077

[ -r /etc/TIMEZONE ] && . /etc/TIMEZONE
[ -r /etc/src.sh ] && . /etc/src.sh && unset SYSTEM_NAME

export PATH=/usr/local/bin:${PATH}:/usr/pkg/bin
PATH="`tcsh -c 'echo ${PATH}'`"

export HOST=${HOST-"`netname`"}
export LOGNAME=${LOGNAME-"${USER}"}
export MAIL=${MAIL-"/var/mail/${LOGNAME}"}
export WWW_HOME="http://kimmo.suominen.com/links/"

cd
export PWD="${HOME}"

unset LANG
export LC_CTYPE=C.UTF-8

export LESSCHARSET=utf-8
export MHN="${HOME}/Mail/.mhn_x"
export MM_CHARSET=utf-8

if [ -r "${HOME}/bin/mp.pro.ps" ]
then	export MP_PROLOGUE="${HOME}/bin"
fi

export XMERGE=vga

export ICBNAME IRCNICK PGPPATH
export ICBNAME="Kim"
export IRCNICK="${ICBNAME}"
export PGPPATH="${HOME}/.pgp"

if [ -d "${HOME}/.ssh" ]
then	EXEC="exec ssh-agent"
else	EXEC="exec"
fi

#
# XREMOTETMPDIR is set by the 'x' script if running on an NCD via Xremote.
#
case "${XREMOTETMPDIR}" in
'')
    XVENDOR=`
	xdpyinfo |
	grep '^vendor string:' |
	sed -e 's/^vendor string://' -e 1q`
    case "${XVENDOR}" in
    *Hummingbird*)
	${EXEC} "${HOME}/.xinitrc-exceed"
	;;
    *)
	${EXEC} "${HOME}/.xinitrc"
	;;
    esac
    ;;
*)
    ${EXEC} "${HOME}/.xinitrc-xremote"
    ;;
esac
