#!/bin/sh

. /usr/share/ltsp/ltsp-common-functions

XINITRCDIR=/usr/share/ltsp/xinitrc.d

# use run-parts to source every file in the xinitrc directory; we source
# instead of executing so that the variables and functions defined above
# are available to the scripts, and so that they can pass variables to each
# other
XINITRCFILES=$(run_parts_list $XINITRCDIR)
if [ -n "$XINITRCFILES" ]; then
  set +e
  for XINITRCFILE in $XINITRCFILES; do
    . $XINITRCFILE
  done
  set -e
fi

exec $@
