Accepting request 35858 from M17N
Copy from M17N/ibus based on submit request 35858 from user tiwai OBS-URL: https://build.opensuse.org/request/show/35858 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ibus?expand=0&rev=1
This commit is contained in:
70
xim.d-ibus
Normal file
70
xim.d-ibus
Normal file
@@ -0,0 +1,70 @@
|
||||
OLD_PATH=$PATH
|
||||
PATH=/usr/bin:/usr/X11R6/bin:/opt/kde3/bin:$PATH
|
||||
|
||||
if ! type -p ibus-daemon > /dev/null 2>&1 ; then
|
||||
echo "ibus is not available."
|
||||
PATH=$OLD_PATH
|
||||
return 1
|
||||
fi
|
||||
|
||||
#when skim installed, Autostart must be "false".
|
||||
#here we move $HOME/.kde/share/config/skimrc to skimrc.orig.ibus
|
||||
case "$WINDOWMANAGER" in
|
||||
*kde*)
|
||||
if type -p skim > /dev/null 2>&1 \
|
||||
&& ! grep -i -q "^[[:space:]]*Autostart.*=.*false" $HOME/.kde/share/config/skimrc
|
||||
then
|
||||
if [ -f $HOME/.kde/share/config/skimrc.orig.ibus ] ; then
|
||||
mv -f $HOME/.kde/share/config/skimrc $HOME/.kde/share/config/skimrc.orig.ibus
|
||||
chmod 777 $HOME/.kde/share/config/skimrc.orig.ibus
|
||||
fi
|
||||
cat > $HOME/.kde/share/config/skimrc << __END
|
||||
[General]
|
||||
Autostart=false
|
||||
__END
|
||||
chmod 777 $HOME/.kde/share/config/skimrc
|
||||
else
|
||||
# do nothing
|
||||
:
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
# do nothing
|
||||
;;
|
||||
esac
|
||||
|
||||
# Determine the LC_CTYPE locale category setting
|
||||
#tmplang=${LC_ALL-${LC_CTYPE-${LANG-en_US}}}
|
||||
|
||||
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
|
||||
## test if use kimpanel
|
||||
## make sure your ibus panel for kimpanel is /usr/libexec/panel.py
|
||||
## or you can specify it below
|
||||
#export KIMPANEL_IBUS=/usr/libexec/panel.py
|
||||
## but there's some problems to startup ibus-panel for kimpanel
|
||||
## use ~/.kde4/Autostart/kimpanel-ibus instead
|
||||
if [ -e /usr/libexec/panel.py ]; then
|
||||
# ibus-daemon --panel=$KIMPANEL_IBUS --xim -d
|
||||
if [ ! -e ~/.kde4/Autostart/kimpanel-ibus ]; then
|
||||
cp /usr/$SYS_LIB/ibus/dbus/kimpanel-ibus \
|
||||
~/.kde4/Autostart/kimpanel-ibus
|
||||
fi
|
||||
else
|
||||
if [ -e ~/.kde4/Autostart/kimpanel-ibus ]; then
|
||||
rm ~/.kde4/Autostart/kimpanel-ibus
|
||||
fi
|
||||
ibus-daemon --xim -d
|
||||
fi
|
||||
|
||||
PATH=$OLD_PATH
|
||||
|
||||
# success:
|
||||
return 0
|
Reference in New Issue
Block a user