#!/bin/sh
#
#
# Creates 3d icons for fvwm
#
# By Joerg Mertin <smurphy@stardust.bln.sub.org>
#
# Start it with: Make3dxpm <original.xpm>
# Needs the Imagemagick Toolkit to be installed !
#
INPUT=$*
FILE=`basename $INPUT .xpm`
CFILE=`basename $INPUT .xpm`_3d.xpm
MFILE=mini.`basename $INPUT .xpm`_3d.xpm
echo "--- Generatin 3d-Pixmaps for $INPUT"
echo "--- Basename is: $FILE"
echo "--- Combine Name is: $CFILE"
echo "--- Mini-Xpm filename is: $MFILE"

# Be carefull here. Note, to center the Icon correctly on the Template,
# have a look at the pixmap size, it's in the 2nd line and starts with 
# something like "32 32 4 56" where the 2 first numbers give you their 
# size. The template got a size of 56x46, so to center the pixmap on it, 
# add a geometry line of: -geometry +12+7 :)-> (56-32)/2=12 and similar 
# for the second value.
combine -compose over -geometry +12+7 $FILE.xpm Template.xpm $CFILE
convert -geometry 14x14! $CFILE xpm:$MFILE

