summaryrefslogtreecommitdiffstats
path: root/source/x/fcitx5/fcitx5-autostart
diff options
context:
space:
mode:
Diffstat (limited to 'source/x/fcitx5/fcitx5-autostart')
-rwxr-xr-xsource/x/fcitx5/fcitx5-autostart36
1 files changed, 36 insertions, 0 deletions
diff --git a/source/x/fcitx5/fcitx5-autostart b/source/x/fcitx5/fcitx5-autostart
new file mode 100755
index 000000000..22d8c056d
--- /dev/null
+++ b/source/x/fcitx5/fcitx5-autostart
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+START="no"
+
+if [ "$XIM" = "fcitx" ]; then
+ START="yes"
+fi
+
+if [ "$XIM_PROGRAM" = "fcitx" ]; then
+ START="yes"
+fi
+
+if [ "$GTK_IM_MODULE" = "fcitx" ]; then
+ START="yes"
+fi
+
+if [ "$QT_IM_MODULE" = "fcitx" ]; then
+ START="yes"
+fi
+
+if [ "$START" = "no" ]; then
+ exit 0
+fi
+
+# 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 seems is not running"
+ fcitx5
+else
+ echo "Fcitx is running correctly."
+fi