#!/bin/bash
# (C) BigHead
# This script is distributed under the GPL.  See the file GPL.
# If you make any improvements, feel free to email me any changes.
#Version:	buildset 1.1



# DEFINE NEW SIZES HERE
#	These are sizes for everything except the actions folder, which contains
#	menu and toolbar related stuff for KDE.  Add or remove a size here, I
#	would recommend not removing the 32, 22, and 16 sizes.
#
#	Note:
#	If you add additional sizes, you must update your index.desktop file to 
#	access the additional icons. I've added the non-standard 56x56 category 
#	as an example.
 
SIZES="128x128 64x64 48x48 32x32 22x22 16x16 8x8"
DIRS="places mimetypes" # no actions directory needed, its hardcoded


#Loop directory creation according to SIZES specified at startup
for size in $SIZES
do
	mkdir -p $size/places $size/mimetypes
done

# Mmmm... loops...
for dir in $DIRS
do
	cd 128x128/$dir
	for icon in *
	do
		# Loop the specified sizes
		for size in $SIZES
		do
			convert "$icon" -resize $size ../../$size/$dir/"$icon"
		done
	done
	# Move from 128x128/$directory to toplevel
	cd ../../
done

# Move to top directory
cd ../../

mkdir $PACKAGENAME
cp -R 128x128 $PACKAGENAME
cp -R 32x32 $PACKAGENAME
cp index.desktop $PACKAGENAME
cp README $PACKAGENAME
cp buildset $PACKAGENAME


