Re: Does our xim process need an update?

Takashi Iwai <[email protected]>
Newsgroups gmane.linux.suse.m17n
Message-ID <[email protected]>
On Thu, 16 Jul 2015 15:51:27 +0200,
Marguerite Su wrote:
> 
> On Thu, Jul 16, 2015 at 9:26 PM, Fuminobu TAKEYAMA <[email protected]> wrote:
> >> 0. Is there any way in shell script, that allows us to dynamically
> >> change input method framework without restart?
> >
> > GTK and Qt applications can switch its IM.
> > But I think there is no way to do from shell script.
> >
> > If we implement GTK IM module/Qt IM module/xim proxy, it could do that.
> 
> our current discussion focus on to replace xim method w/
> chameleon-tongue, and the most critical mission for all such
> technology is to properly set:
> 
> export LC_CTYPE=$LANG
> export XMODIFIERS="@im=fcitx"
> export GTK_IM_MODULE=fcitx
> export GTK3_IM_MODULE=fcitx
> export QT_IM_SWITCHER=imsw-multi
> export QT_IM_MODULE=fcitx
> export QT4_IM_MODULE=fcitx
> 
> to make input method framework take over users' input.

I thought GTK3_* and QT4_* are superfluous nowadays as Gtk3 and Qt4
look at GTK_* and QT_* variables as well?

> and all such
> applications/ways can only set input method globally once at system
> boot (I might be wrong about this).

Not at boot, but at each X session / login.

> after Xorg was started, there's no
> way to swich input method frameworks. My question is, is there such
> thing like:
> 
> export FCITX_ENV=`/usr/lib/inputmethod/scripts/check_if_fcitx_is_running_and_prefered.sh`
> export GTK_IM_MODULE=$FCITX_ENV
> 
> works. So when an application is started, it'll actually fetch
> GTK_IM_MODULE by running a script, which can check process of input
> method framework and /etc/sysconfig/inputmethod or something to find
> user preference. So you can switch from fcitx to ibus without the need
> to restart/logout.

I guess a wrapper like

#!/bin/sh
. /usr/lib/input-method/profile.d/auto/env
exec "$@"

would work.  But it's doubtful whether such a dynamic switch is really
demanded.  Even with this mechanism, an application needs to be
restart in anyway.  If a DE has some session management, it can
restart itself and restores the session after refreshing the
IM-related environment variables.

> Or we have to write an special im module named "imfd" or something to
> dynamically set and load input method frameworks?
> 
> BTW, I think along with shell scripts, ruby is also a good
> alternative, because every openSUSE installation have YaST and ruby
> :-)

Yes, but I don't think there won't be so complicated even in bash.
Let's see.


Takashi
-- 
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.