summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-includes/etc/X11/Xsession.d/80im-starter
blob: 9d5e9a37a4a607718432416ff18d4672d6a61c42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/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/_.*//'`

case "$LANGPREFIX" in
   ja)
      PREFLIST='[anthy,pinyin,hangul]'
      ;;
   ko)
      PREFLIST='[hangul,pinyin,anthy]'
      ;;
   *)
      PREFLIST='[pinyin,anthy,hangul]'
esac

# 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'