2015-08-10 15:44:14 +02:00
|
|
|
if ! type ibus-daemon > /dev/null 2>&1 ; then
|
2011-09-14 11:21:19 +02:00
|
|
|
echo "ibus is not available."
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$WINDOWMANAGER" in
|
2014-05-20 16:40:03 +02:00
|
|
|
#when skim installed, Autostart must be "false".
|
|
|
|
#here we move $HOME/.kde/share/config/skimrc to skimrc.orig.ibus
|
2011-09-14 11:21:19 +02:00
|
|
|
*kde*)
|
|
|
|
;;
|
2014-05-20 16:40:03 +02:00
|
|
|
# GNOME 3 Settings Daemon keyboard plugin manages all ibus settings itself,
|
|
|
|
# so don't do manual setup&startup of ibus otherwise it would conflict with
|
|
|
|
# G-S-D. see bnc#873016.
|
2014-08-22 18:42:57 +02:00
|
|
|
*gnome*)
|
|
|
|
SOURCES=$(gsettings get org.freedesktop.ibus.general preload-engines)
|
|
|
|
if [ "$SOURCES" == '@as []' ]; then
|
|
|
|
echo "initial GNOME startup, ibus default configuration applied"
|
|
|
|
ibus-daemon -d
|
|
|
|
timer=5
|
|
|
|
while [ "$SOURCES" == '@as []' ] && [ ${timer} -gt 0 ]; do
|
|
|
|
sleep 1
|
|
|
|
timer=$[${timer}-1]
|
|
|
|
SOURCES=$(gsettings get org.freedesktop.ibus.general preload-engines)
|
|
|
|
done
|
|
|
|
ibus exit
|
|
|
|
fi
|
2014-05-20 16:40:03 +02:00
|
|
|
# make sure G-S-D keyboard plugin is active
|
|
|
|
echo "ibus will be managed by GNOME."
|
|
|
|
gsettings set org.gnome.settings-daemon.plugins.keyboard active true
|
|
|
|
return 0
|
|
|
|
;;
|
2011-09-14 11:21:19 +02:00
|
|
|
*)
|
|
|
|
# do nothing
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2013-11-25 15:19:37 +01:00
|
|
|
# Force OOo to use gtk-immodule
|
2014-10-08 17:36:03 +02:00
|
|
|
# Only libreoffice-gnome supports IM module
|
|
|
|
# To fix cursor following problem (on_the_spot), do not use libreoffice-kde4
|
|
|
|
if [ -e /usr/lib64/libreoffice/program/libvclplug_gtklo.so ] ||
|
|
|
|
[ -e /usr/lib/libreoffice/program/libvclplug_gtklo.so ] ||
|
|
|
|
[ -e /usr/lib64/libreoffice/program/libvclplug_gtk3lo.so ] ||
|
|
|
|
[ -e /usr/lib/libreoffice/program/libvclplug_gtk3lo.so ]; then
|
|
|
|
export OOO_FORCE_DESKTOP=gnome
|
|
|
|
else
|
|
|
|
echo "libreoffice-gnome is not found. For better IBus support, please install libreoffice-gnome"
|
|
|
|
fi
|
2011-09-14 11:21:19 +02:00
|
|
|
|
2014-05-20 16:40:03 +02:00
|
|
|
export LC_CTYPE=$LANG
|
|
|
|
export XMODIFIERS="@im=ibus"
|
|
|
|
export GTK_IM_MODULE=ibus
|
|
|
|
export QT_IM_SWITCHER=imsw-multi
|
|
|
|
if [ -e /usr/$SYS_LIB/qt4/plugins/inputmethods/libqtim-ibus.so ]; then
|
|
|
|
export QT_IM_MODULE=ibus
|
|
|
|
else
|
|
|
|
export QT_IM_MODULE=xim
|
|
|
|
fi
|
2011-09-14 11:21:19 +02:00
|
|
|
|
2014-05-20 16:40:03 +02:00
|
|
|
if [ -z $DBUS_SESSION_BUS_ADDRESS ]; then
|
|
|
|
eval `dbus-launch --sh-syntax --exit-with-session --close-stderr < /dev/null`
|
|
|
|
fi
|
2011-09-14 11:21:19 +02:00
|
|
|
|
2014-05-20 16:40:03 +02:00
|
|
|
ibus-daemon --xim -d
|
2011-09-14 11:21:19 +02:00
|
|
|
|
|
|
|
# success:
|
|
|
|
return 0
|