#!/bin/sh
# Shell-Script to generate an application-menu for windowmaker from the
# GNUstep directory structure.
#
# (C) 2003 Joachim Jaeckel Joachim.Jaeckel@coffeebreak.de

OUTPUT_DIR=""
OUTPUT_APPS=""

echo "\"GNUstep\" MENU"
cd ${GNUSTEP_ROOT}
for i in `find . -name Applications | sort`
do
	OUTPUT_DIR=`echo $i | cut -c 3- | cut -f 1 -d "/"`
	echo "  \"${OUTPUT_DIR}\" MENU"
	cd $i
	for j in `find . -name "*.app" | sort`
	do
		OUTPUT_APPS=`echo $j|cut -c 3-`
		echo "    \"${OUTPUT_APPS}\" EXEC openapp ${OUTPUT_APPS}"
	done
	cd -
	echo "  \"${OUTPUT_DIR}\" END"
done
echo "\"GNUstep\" END"
