#!/bin/sh

USERDIR=$HOME/GNUstep/Library/WindowMaker/autostart.d
SYSDIR=/usr/share/WindowMaker/autostart.d
DIRS="$SYSDIR"
if [ -d "$USERDIR" ]; then
    DIRS="$DIRS $USERDIR"
fi
FILES=`find $DIRS -type f -printf '%f\n' |sort -u`

for f in $FILES; do
	if [ -x "$USERDIR/$f" ]; then
		. "$USERDIR/$f"
	elif [ -x "$SYSDIR/$f" ]; then
		. "$SYSDIR/$f"
	fi
done

