Bug 119785 - all IM configuration code should be separated out of xinput
all IM configuration code should be separated out of xinput
Product: Fedora
Classification: Fedora
Component: xinitrc (Show other bugs)
All Linux
high Severity medium
: ---
: ---
Assigned To: Mike A. Harris
: FutureFeature, i18n
Depends On:
Blocks: 119404 IIIMF
  Show dependency treegraph
Reported: 2004-04-02 01:20 EST by Jens Petersen
Modified: 2007-11-30 17:10 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-06-29 14:04:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
current xinput.d/ patch (7.74 KB, patch)
2004-04-07 07:51 EDT, Jens Petersen
no flags Details | Diff
xinitrc with xinput.d support (1.68 KB, text/plain)
2004-04-07 07:52 EDT, Jens Petersen
no flags Details
current xinitrc xinput.d/ patch (untested) (7.35 KB, patch)
2004-04-07 08:02 EDT, Jens Petersen
no flags Details | Diff
tested and working implementation of xinput.d/ (8.00 KB, patch)
2004-04-09 11:18 EDT, Jens Petersen
no flags Details | Diff
latest working xinput file (shorter than patch) (1.76 KB, text/plain)
2004-04-09 11:19 EDT, Jens Petersen
no flags Details
newer tested xinput.sh with a few more improvements (1.53 KB, text/plain)
2004-06-22 10:22 EDT, Jens Petersen
no flags Details
patch to update xinitrc/xinput for xinput.d/ (8.85 KB, patch)
2004-06-23 02:36 EDT, Jens Petersen
no flags Details | Diff

  None (edit)
Description Jens Petersen 2004-04-02 01:20:17 EST
xinput currently has hard-coded configuration code for each of
the various Input Method configurations of the CJK locale.
It would make maintenance of xinput much easier if all the
configuration code was moved out into separate scripts packaged
individually with each IM client.  Then xinput could just source
the script appropriate for the locale, and it would become very simple.

Tagoh and I discussed this idea a couple of days ago on irc and
basically we came up with the idea that there should be a directory
say /etc/X11/xinit/xinput.d/ that would contain symlinks:

    xinput-hi_IN -> /usr/share/xinput.d/htt
    xinput-ja_JP -> /usr/share/xinput.d/kinput2-canna
    xinput-ko_KO -> /usr/share/xinput.d/nabi
    xinput-zh_CN -> /usr/share/xinput.d/htt
    xinput-zh_TW -> /usr/share/xinput.d/htt

which would allow multiple input methods to be installed
for the same locale and for sites to be able to change
the default IM per locale by changing the symlinks (as
Tagoh suggested using alternatives would surely be the best
way to handle this).  [By default of course all the symlinks
(installed by iiimf) would be to htt since that is our default IM
for fc2 but I put in various examples above to illustrate what is

Users would still be able to override the system default by setting
XIM in their ".i18n" file, which would result in
/usr/share/xinput.d/$XIM being sourced instead.

All the actual files in /usr/share/xinput.d/ will be maintained
by the corresponding packages, and this will also make it much
easier to add new IMs in the future without having to edit xinput
everytime, or users having to resort to using ".i18n" for this.

I have already started a test implementation of this, which
I hope to have ready shortly: I'll add it here when I have tested
Comment 1 Mike A. Harris 2004-04-02 02:30:37 EST
I think this is a wonderful idea Jens, and I like the design
overview as well.  I would not put it in /usr/share I don't think
though.  It should probably be in /etc/X11/xinit or somewhere
else under /etc/X11 no?

I think it'd be good to get some feedback from others as well, to
hone the design and hear other ideas too, so I've added a few people
to CC for comment.

It'd be nice to have this for FC2 I think.

Comment 2 Mike A. Harris 2004-04-02 02:33:51 EST
Just after hitting submit, I thought that it might be a good idea
to bounce this idea of fedora-devel-list to see if any volunteers
have additional modularization suggestions, etc.

Another benefit of this design, is that a bug in xinput script right
now can potentially kill all IM users.   While that's still true for
the above design, it is much less of a chance because a lot of the
code gets factored out, reducing risk.  As we know, we've both
recently broken xinitrc files in interesting ways recently, so
this would help mitigate our rampant carelessness in the future.

I know I kicked myself a few times for some of those dumb bugs
I goofed up.  ;o)

Thanks again,
Comment 3 Jens Petersen 2004-04-05 23:37:17 EDT
Mike, yep you're right we don't need "/usr/share/xinput.d/":
"/etc/X11/xinit/xinput.d/" should have symlinks like:

/etc/X11/xinit/xinput.d/hi_IN -> /etc/alternatives/xinput-hi_IN
/etc/X11/xinit/xinput.d/ja_JP -> /etc/alternatives/xinput-ja_JP
/etc/X11/xinit/xinput.d/ko_KO -> /etc/alternatives/xinput-ko_KO
/etc/X11/xinit/xinput.d/zh_CN -> /etc/alternatives/xinput-zh_CN
/etc/X11/xinit/xinput.d/zh_TW -> /etc/alternatives/xinput-zh_TW

and then for example

/etc/alternatives/xinput-hi_IN -> /etc/X11/xinit/xinput.d/htt
/etc/alternatives/xinput-ja_JP -> /etc/X11/xinit/xinput.d/kinput2-canna
/etc/alternatives/xinput-ko_KO -> /etc/X11/xinit/xinput.d/nabi
/etc/alternatives/xinput-zh_CN -> /etc/X11/xinit/xinput.d/htt
/etc/alternatives/xinput-zh_TW -> /etc/X11/xinit/xinput.d/htt
Comment 4 Mike A. Harris 2004-04-06 22:37:45 EDT

Ok, sounds reasonable to me.  How about posting this idea to
fedora-devel-list for community feedback?

Also, I'm not sure wether we should do this for FC2, or wait for
FC3 now, as time is tight, and there's lots of work yet to do.  What
do you think?

Thanks in advance,
Comment 5 Jens Petersen 2004-04-07 07:46:06 EDT
You're probably right actually: I agree it is late to be doing
this now, so let's defer it to FC3.
Comment 6 Jens Petersen 2004-04-07 07:51:10 EDT
Created attachment 99182 [details]
current xinput.d/ patch

Here's my xinput.d patch in its current form for the record.
Comment 7 Jens Petersen 2004-04-07 07:52:32 EDT
Created attachment 99183 [details]
xinitrc with xinput.d support

and the xinput file itself, which is shorter than the above patch...
Comment 8 Jens Petersen 2004-04-07 08:02:04 EDT
Created attachment 99184 [details]
current xinitrc xinput.d/ patch (untested)

for the record here is my current patch for implementating xinput.d/ support.
Comment 10 Jens Petersen 2004-04-09 11:18:20 EDT
Created attachment 99273 [details]
tested and working implementation of xinput.d/
Comment 11 Jens Petersen 2004-04-09 11:19:55 EDT
Created attachment 99274 [details]
latest working xinput file (shorter than patch)
Comment 12 Jens Petersen 2004-04-12 20:03:21 EDT
Mike, since Test3 is delayed for a week,
I think it would be good to get this into FC2
after all.  What do you think?
Comment 16 Jens Petersen 2004-04-14 03:26:37 EDT
Actually I forgot to mention that xinput needs fixing anyway because of
"service <server> status" no longer working under selinux for normal

Shortly after test2 I realised that the current version of xinput using
"service IIim status" was just a temporary fix to the problems in test2
because of service status with selinux not working - and it was thinking
of how to best fix that that led to the idea of input.d/ support. 
It really would be the simplest way to fix xinput now, IMHO.
Comment 19 Jens Petersen 2004-06-01 01:28:19 EDT
It occurred to me that since most non-Asian users do not need to
use any Input Methods (IMs) at all when running X, there is no need
for them all to run xinput (xinput.sh) every time they start an
X session since it is just a no-op for them.  Therefore it would
make more sense to move xinput out into a separate package that
IM packages would require.  This package could also im-switch and
a future GUI IM confiuration problem.

This would lead to less bug reports on xinitrc from people who
don't actually need xinput.sh.  And since the I18N Team can
maintain the new package, it will ease the current problem of
having to overcome the hurdle everytime of getting xinput updated
in xinitrc, and reduce the maintainence burden on the xinitrc
Comment 20 Jens Petersen 2004-06-22 10:22:42 EDT
Created attachment 101334 [details]
newer tested xinput.sh with a few more improvements

Mike, here is an update of xinput.sh with xinput.d/ support for FC3.

I still think separating out xinput.sh into a separate package is a good
idea though and with the latest xinitrc only sourcing xinitrc.d/*.sh have had
chance to test running without xinput and I haven't seen any problems yet
(when one doesn't want to use an IM).
Comment 21 Jens Petersen 2004-06-23 02:36:18 EDT
Created attachment 101352 [details]
patch to update xinitrc/xinput for xinput.d/

Above is an updated patch to add the new xinput to xinitrc.
Patch included necessary changes to spec file (including changelog)
and Makefile to rename xinput to xinput.sh.
Comment 23 Mike A. Harris 2004-06-29 14:04:32 EDT
Committed to xinitrc-4.0.1-1, built into FC3 devel.

Please test.

Note You need to log in before you can comment on or make changes to this bug.