ibus/xim.d-ibus-121
Fuminobu Takeyama b7af184101 Accepting request 362444 from home:tiwai:branches:M17N
(Resubmission with NoDisplay=true in autostart.desktop)

- Fix the invocation of ibus service for KDE, etc (boo#968486):
  for DEs known to support autostart (KDE, XFCE and LXCE), ibus is
  now started via XDG autostart for avoiding the race.  This should
  fix the missing ibus service.  For other DEs, ibus is still
  started in xim script, but with a slight (two seconds) delay for
  avoiding the race, too.
  Along with the change, INPUT_METHOD environment variable is set
  explicitly in xim script at startup; this is referred in XDG
  autostart so that it won't be executed when other IM is chosen.
  Last but not least, the explicit dbus-launch invocation is dropped,
  as it's known to conflict with DE's own startup of dbus

OBS-URL: https://build.opensuse.org/request/show/362444
OBS-URL: https://build.opensuse.org/package/show/M17N/ibus?expand=0&rev=146
2016-02-28 16:32:13 +00:00

67 lines
2.1 KiB
Plaintext

if ! type ibus-daemon > /dev/null 2>&1 ; then
echo "ibus is not available."
return 1
fi
# explicitly set below, as referred in xdg autostart
export INPUT_METHOD=ibus
case "$WINDOWMANAGER" in
# 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.
*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
# 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
;;
esac
# Force OOo to use gtk-immodule
# 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
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
case "$WINDOWMANAGER" in
*kde*|*xfce*|*lxde*)
# started via xdg autostart
;;
*)
# FIXME: a little bit of delay is required to avoid race
(sleep 2; ibus-daemon --xim -d) &
;;
esac
# success:
return 0