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

export LANG=zh_CN.GB2312

if [ -x /usr/X11R6/bin/crxvt ]; then
    /usr/X11R6/bin/crxvt -im xcin-zh_CN.GB2312 -pt Root \
    -e /usr/bin/cedictlookup -vd /usr/share/cedict -vf cedict.GB
elif [ -x /usr/X11R6/bin/cxtermb5 ]; then
    /usr/X11R6/bin/cxtermb5 -e /usr/bin/cedictlookup -vd /usr/share/cedict \
                                                     -vf cedict.GB
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
