[Uim] uim environment problems

Paul TBBle Hampson Paul.Hampson at anu.edu.au
Wed Aug 10 11:10:13 EEST 2005


On Mon, Aug 08, 2005 at 02:34:03PM +0200, Jan Willem Stumpel wrote:

(Off topic, but I think vaugely relevant. If not, feel free to
thwack me. ^_^)

> What are the opinions on this list about the Debian im-switch system (which
> is now automatically installed when you install uim)?

> After some recent Debian (Sid) upgrade uim-xim did not work anymore on my
> system. It turned out that some new file, /etc/X11/Xsession.d/90im-switch,
> unset the XMODIFIERS and GTK_IM_MODULE environment variables.

> It seems im-switch makes the default assumption that only people whose LANG
> setting is Japanese, Chinese, or Korean would ever have need of uim. For
> instance:

>    jws at vega:~$ im-switch -l
>    No alternatives defined for language en_GB
>    =======================================================
>    The following languages have been configured to use input
>    methods:
>    ja_JP

> But I think the whole point of UTF-8 internationalisation is that anybody
> should be able to input any language, no matter what the (GUI) interface
> language of the user's computer happens to be.

This is controlled by /etc/X11/xinit/xinput.d/. A file in there with the name
of the locale causes that locale to list something in im-switch. It will also
fall back to 'default' if there's no matching locale name.

(The locale here is $LC_ALL (fallback to $LC_CTYPE and then fallback to $LANG))

It's up to the input methods to drop things in there, and register themselves
as alternatives to the locale name.

im-switch registers 'none' as an alternative for ja_JP, and uim-prime registers
itself as an alternative too, and provides /etc/X11/xinit/xinput.d/uim_prime.

However, the XSession script also looks in $HOME/.xinput.d/,  for both locale
name and default.

So if you want to set a default IM for the system:
ln -s /etc/X11/xinit/xinput.d/{inputmethod} /etc/X11/xinit/xinput.d/default
and if you want to set a default for this user account
mkdir .xinput.d
ln -s /etc/X11/xinit/xinput.d/{inputmethod} .xinput.d/default

I have to say, im-switch seems to have code to deal with this sensibly. If
you're root, it uses the alternatives system. If you're not, it sets up the
symlinks for you. I just did im-swtich -s uim_prime, and it set up the
symlink as .xinput.d/en_AU => /etc/X11/xinit/xinput.d/uim_prime correctly.
If I had any comment, it's that the IMs should probably install their scripts
into /usr/share, although I guess if the script needs editing, then /etc is
the place for it...

Currently, im-switch only provides an alternatives setup for ja_JP, and so only
things working in ja_JP can present themselves as alternatives for system-wide
setting, but any IM could ship a file in /etc/X11/xinit/xinput.d for the admin
or users to symlink by hand or with im-swtich (as a user).

If other language users feel that there are sufficient input methods to warrant
an alternatives system, I'm sure the im-switch maintainer would have no issues
adding an alternative for that language's locale to 'none', and then the
various IMs in question only need to register themselves as an alternative for
the locales they make sense in.

However, I don't think an alternative for _every_ locale is sensible.

(I can understand that 'default' should always default to nothing, just to
avoid nasty surprises. ^_^)

I am glad you mentioned this. I looked into it before as the reason why my
uim-prime/uim-xim had stopped working, but for some reason eliminated it at
the time, but certainly im-switch comes after .xsession, and that might be
my problem after all. *goes to restart X* If that _is_ the problem, then
it's a bug in im-switch. It shouldn't be _clearing_ environment variables
if there's no script set for that locale.

-- 
-----------------------------------------------------------
Paul "TBBle" Hampson, MCSE
8th year CompSci/Asian Studies student, ANU
The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361)
Paul.Hampson at Anu.edu.au

"No survivors? Then where do the stories come from I wonder?"
-- Capt. Jack Sparrow, "Pirates of the Caribbean"

License: http://creativecommons.org/licenses/by/2.1/au/
-----------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/uim/attachments/20050810/cfeb6823/attachment.pgp 


More information about the uim mailing list