summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinterFairy <winterfairy@riseup.net>2013-11-05 20:13:29 +0000
committerWinterFairy <winterfairy@riseup.net>2013-11-06 19:22:38 +0000
commit47bfd8927e4b9fc8e4115d1026ee30ab510f089a (patch)
treeb7a28ccbc28d89cee87a072887c6d5aa1ad899d8
parenta3660da9423bf850af5a27482623896fc2457bcd (diff)
Add a new login script that configures and enables IBus.
This login script will enable IBus for all locales, but for Japanese, Chinese and Korean it will also select the right default input method for that language. This replaces im-switch, as it not only starts IBus, but actually configures it correctly for usage in Tails.
-rw-r--r--config/chroot_local-includes/etc/X11/Xsession.d/80im-starter33
1 files changed, 33 insertions, 0 deletions
diff --git a/config/chroot_local-includes/etc/X11/Xsession.d/80im-starter b/config/chroot_local-includes/etc/X11/Xsession.d/80im-starter
new file mode 100644
index 0000000..b84ed95
--- /dev/null
+++ b/config/chroot_local-includes/etc/X11/Xsession.d/80im-starter
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# Start the IBus input method and configure it with
+# sensible settings for use in Tails.
+
+# The input method will be configured so it is usable
+# no matter what locale the user login with, but with
+# correct default engine for those locales that need it.
+
+# Deside order in which input methods are preferred
+# (chinese needs pinyin, japanese needs anthy, korean needs hangul)
+LANGPREFIX=`echo "$LANG" | sed 's/_.*//'`
+PREFLIST="[pinyin,anthy,hangul]"
+
+if [ "$LANGPREFIX" = "ja" ]; then
+ PREFLIST="[anthy,pinyin,hangul]"
+fi
+
+if [ "$LANGPREFIX" = "ko" ]; then
+ PREFLIST="[hangul,pinyin,anthy]"
+fi
+
+# Configure enabled input methods and their preferred order
+gconftool-2 --type=list --list-type=string --set \
+ /desktop/ibus/general/preload_engines "$PREFLIST"
+
+# Start the IBus input method daemon
+/usr/bin/ibus-daemon --daemonize --xim
+
+# Export environment variables to enable use of IBus
+export GTK_IM_MODULE="ibus"
+export QT_IM_MODULE="ibus"
+export XMODIFIERS="@im=ibus"