# start uim
# vim: set sts=4 expandtab:

if [ "$IM_CONFIG_PHASE" = 2 ]; then
# start uim-xim daemon
if [ -x /usr/bin/uim-xim ]; then
    /usr/bin/uim-xim &
fi
# Starting GUI
if [ -x /usr/bin/uim-toolbar ]; then
    ( sleep 5 ; env GDK_BACKEND=x11 uim-toolbar ) &
elif [ -x /usr/bin/uim-toolbar-gtk3 ]; then
    ( sleep 5 ; env GDK_BACKEND=x11 uim-toolbar-gtk3 ) &
elif [ -x /usr/bin/uim-toolbar-gtk ]; then
    ( sleep 5 ; env GDK_BACKEND=x11 uim-toolbar-gtk ) &
elif [ -x /usr/bin/uim-toolbar-qt4 ]; then
    ( sleep 5 ; uim-toolbar-qt4 ) &
elif [ -x /usr/bin/uim-toolbar-qt5 ]; then
    ( sleep 5 ; uim-toolbar-qt5 ) &
fi

fi

if [ "$IM_CONFIG_PHASE" = 1 ]; then
# set variables for the plain XIM
XMODIFIERS=@im=uim

# Let's assume all required modules are installed
GTK_IM_MODULE=uim
QT4_IM_MODULE=uim
QT_IM_MODULE=uim
# ume has no clutter support
CLUTTER_IM_MODULE=xim

fi
