#!/bin/sh
# vim:set et sts=4 sw=4
#
# ibus-hunspell-table - The Tables engine for IBus
#
# Copyright (c) 2011-2012 Anish Patil <anish.developer@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#  This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#  You should have received a copy of the GNU General Public License 
# along with this program.  If not, see <http://www.gnu.org/licenses/>

prefix=/usr
datarootdir=${prefix}/share
datadir=/usr/share
export IBUS_HUNSPELL_TABLE_LOCATION=${prefix}/share/ibus-typing-booster

for arg in $@; do
	case $arg in
	--xml | -x)
		exec python ${prefix}/share/ibus-typing-booster/engine/main.py --xml;;
	--help | -h)
		exec python ${prefix}/share/ibus-typing-booster/engine/main.py $@;;
  *)
    # first running speedmeter as a daemon
    #python ${prefix}/share/ibus-hunspell-table/engine/speedmeter.py -d > /dev/null

    # then start our IME
    exec python ${prefix}/share/ibus-typing-booster/engine/main.py $@
    exit 0
	esac
done

