#!/bin/sh

test x"$INPUT_METHOD" = x"fcitx5" || exit 0

# sleep for a little while to avoid duplicate startup
sleep 2

# Test whether fcitx is running correctly with dbus...
fcitx5-remote > /dev/null 2>&1

if [ $? = "1" ]; then
    echo "Fcitx 5 seems is not running"
    fcitx5
else
    echo "Fcitx 5 is running correctly."
fi
