#! /bin/bash
if [ -z "$1" ]; then
       echo "missing parameter..."
       echo ""
       echo "usage:"
       echo "$0 LayoutEditor"
       echo "$0 ImageSetViewer"
       echo "$0 FontViewer"
       echo ""
       exit 1
fi

# create local working directory
if [ ! -d $HOME/.mygui ]; then
       mkdir -p $HOME/.mygui

       # config should be user writeable
       cp /usr/share/MYGUI/*.cfg $HOME/.mygui
       cp /usr/share/MYGUI/*.xml $HOME/.mygui
fi

# call binary from local working-directory
cd $HOME/.mygui
/usr/bin/$1
