#!/bin/sh
if [ ! -f /usr/share/cedict/cedict.b5 ]; then
    xterm -T Error -e sh -c 'echo \*\*\* CEDict data not found, so CEDict Lookup cannot be started \*\*\*; echo Please install the cedictb5 package first; echo Press ENTER to exit; read'
    exit 1
fi

export LANG=zh_TW.Big5

if [ -x /usr/X11R6/bin/crxvt ]; then
    /usr/X11R6/bin/crxvt -im xcin -pt Root -e /usr/bin/cedictlookup -vd /usr/share/cedict \
                                                  -vf cedict.b5
elif [ -x /usr/X11R6/bin/cxtermb5 ]; then
    /usr/X11R6/bin/cxtermb5 -e /usr/bin/cedictlookup -vd /usr/share/cedict \
                                                     -vf cedict.b5
else
    xterm -T Error -e sh -c 'echo \*\*\* I cannot find a Chinese X terminal, so CEDict Lookup cannot be started \*\*\*; echo Press ENTER to exit; read'
fi
