2015-08-10 17:48:07 +02:00
|
|
|
function failure
|
|
|
|
{
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
|
|
|
function success
|
|
|
|
{
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
if ! [ -x /usr/bin/fcitx ] ; then
|
|
|
|
echo "fcitx is not installed. please 'sudo zypper in fcitx'."
|
|
|
|
$failure
|
2011-06-14 08:03:57 +02:00
|
|
|
fi
|
|
|
|
|
2013-12-07 05:47:55 +01:00
|
|
|
#make sure set these vars before dbus-launch
|
2012-06-12 10:16:02 +02:00
|
|
|
export LC_CTYPE=$LANG
|
|
|
|
export XMODIFIERS="@im=fcitx"
|
|
|
|
export GTK_IM_MODULE=fcitx
|
2013-07-01 19:32:04 +02:00
|
|
|
export GTK3_IM_MODULE=fcitx
|
2012-06-12 10:16:02 +02:00
|
|
|
export QT_IM_SWITCHER=imsw-multi
|
|
|
|
export QT_IM_MODULE=fcitx
|
2014-05-01 16:30:06 +02:00
|
|
|
export QT4_IM_MODULE=fcitx
|
2013-12-07 05:47:55 +01:00
|
|
|
|
|
|
|
# Avoid relying on autolaunch to improvise D-Bus sessions for each process
|
2015-08-10 17:48:07 +02:00
|
|
|
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] ; then
|
|
|
|
eval $(dbus-launch --sh-syntax --exit-with-session)
|
2013-12-07 05:47:55 +01:00
|
|
|
fi
|
|
|
|
|
2012-06-12 10:16:02 +02:00
|
|
|
fcitx -d
|
2011-06-14 08:03:57 +02:00
|
|
|
|
|
|
|
# success:
|
2015-08-10 17:48:07 +02:00
|
|
|
$success
|