source: src-qt4/xtrafiles/local/share/pcbsd/xstartup/enable-ibus.sh @ 8acecf9

releng/10.0
Last change on this file since 8acecf9 was 8acecf9, checked in by Kris Moore <kris@…>, 7 months ago

Add patch from Jun Yamashiro, fixing ibus japanese input

  • Property mode set to 100755
File size: 1.4 KB
Line 
1#!/bin/sh
2
3# Set this to YES if you want to manually enable ibus
4FORCEIBUS="NO"
5
6# Do not modify below
7##########################################################################
8
9ibus_initialize() {
10  if [ ! -f ${HOME}/.gconf/desktop/ibus/general/%gconf.xml ]
11  then
12    gconftool-2 --set --type list --list-type=string /desktop/ibus/general/preload_engines "[${1}]"
13  fi
14}
15
16# Check if this lang needs ibus
17case ${LANG} in
18  ja_JP*)
19  ibus_initialize "mozc-jp"
20  ENABLE="YES"
21  ;;
22  ko_KR*)
23  ibus_initialize "m17n:ko:romaja"
24  ENABLE="YES"
25  ;;
26  zh_CN*)
27  ibus_initialize "pinyin"
28  ENABLE="YES"
29  ;;
30  zh_TW*)
31  ibus_initialize "chewing"
32  ENABLE="YES"
33  ;;
34  *) ENABLE="NO" ;;
35esac
36
37# If the user requested to enable IBUS manually
38if [ "${FORCEIBUS}" = "YES" ]
39then
40  ENABLE="YES"
41fi
42
43# If we are using ibus, set vars and enable daemon
44if [ "${ENABLE}" = "YES" ]
45then
46  # In some PBI, iBus GTK IM module makes GTK version mismatch error
47  # with GTK libraries included in the PBI package.
48  #GTK_IM_MODULE="ibus" ; export GTK_IM_MODULE
49 
50  QT_IM_MODULE="ibus" ; export QT_IM_MODULE
51  XMODIFIERS="@im=ibus" ; export XMODIFIERS
52
53  # For PBI applications
54  GTK_IM_MODULE="xim" ; export GTK_IM_MODULE
55  GTK_IM_MODULE_FILE=/usr/local/etc/gtk-2.0/gtk.immodules ; export GTK_IM_MODULE_FILE
56  /usr/local/bin/ibus-daemon --xim &
57
58  # Enable GDK_NATIVE_WINDOWS
59  GDK_NATIVE_WINDOWS="true" ; export GDK_NATIVE_WINDOWS
60fi
Note: See TracBrowser for help on using the repository browser.