#!/bin/bash

SESSIONDIR=/etc/X11/Xsession.d
STARTUP=

#TODO Create error file (~/.xsession-errors) here

echo "X session started for $LOGNAME at $(date)"

if [ -d $SESSIONDIR ]; then
    for file in $SESSIONDIR/*.sh; do
        . $file
    done
fi

exec -l $SHELL -c "$STARTUP"

# Control should never reach here
exec -l $SHELL -c "xsm"
