#!/bin/bash


#LOG=session-start
SDIR=/etc/groovix/session-start.d


#don't need to log things, will end up in $HOME/.xsession-errors
#log everything
#cp /var/log/groovix/$LOG.log.2 /var/log/groovix/$LOG.log.3
#cp /var/log/groovix/$LOG.log.1 /var/log/groovix/$LOG.log.2
#cp /var/log/groovix/$LOG.log /var/log/groovix/$LOG.log.1
#exec 3>&1 4>&2
#trap 'exec 2>&4 1>&3' 0 1 2 3
#exec 1>/var/log/groovix/$LOG.log 2>&1


#many Groovix scripts refer to GUNAME
GUNAME=$USER

echo GKDEBUG starting $0 at `date`

. /usr/share/groovix/global.conf

# per user settings
if [ -e /etc/groovix/peruser/$GUNAME/groovix.conf ] ; then
        . /etc/groovix/peruser/$GUNAME/groovix.conf
fi

#do session things that need to be started as root before and after actual session:
# i.e. cmon/pacrez/screensaver/inactivity stop/start

#note: these scripts are explicitly called with bash, so no need
# to include #!/bin/bash in each one
#also they do not need to be executable, they are not meant to be called on their own
# note that any variables set in each sub script will not be visible to sibling scripts
	# if we want that then maybe rewrite groovix-source-bash-parts to just concat
	# then all together and execute as one big script

. /usr/bin/groovix-source-bash-parts $SDIR ; #old# 2>&1 >> /var/log/groovix/session-root.log


