On Sat, Jun 04, 2005 at 12:10:30PM +1200, Carlos Z.F. Liu wrote:
> 刚在 debian-devel 上看到 Kenshi Muto 提交了 im-switch 的 
> ITP。这应该就
> 是前些时候咱们讨论过的自动选定输入法的脚本。有兴趣的不妨试一试。

现在 Kenshi Muto 已经将 im-switch 1.0 上传到 unstable 
了,当初讨论输入法
自动启动的时候似乎有不少人感兴趣,现在有了这么一个实做,有人试用么?

可能很多人看英语费劲,我就用中文把 im-switch 
大概解释一下吧:

Forwarded message from Kenshi Muto <[EMAIL PROTECTED]>
> im-swich is the input method (IM) framework partially ported from
> FedraCore to Debian.

im-switch 参考了 Federa Core 里面对输入法的处理。

> The input method package which uses im-switch framework becomes one of
> the "alternative" under the im-switch. This framework enables
> auto-selection of default input method which can be configured by the
> `im-switch' command. One notable feature of im-swich is this system
> offers both global selection and user level selection.

im-switch 的基础还是 Debian 的 alternatives 系统。

> $ im-switch -l

现在 im-switch 
似乎还是一个基于命令行的工具,没有图形界面。
> You have ja_JP setup in "/home/kmuto/.xinput.d".
> provided by im-switch for XIM nor IMmodule.
> 
> * for maintainers
> 
> Each input method package places package specific parameter file in
> /etc/X11/xinit/xinput.d/ (Samples are available under
> /usr/share/doc/im-switch/sample/).  If canna is used as the backend
> IM, kinput2-canna provides following configuration files:

每个输入法 package 可以在 /etc/X11/xinit/xinput.d/ 
里面安装有关自己输入
法的设置文件。

> When input method requires multiple backend, you may provide multiple
> files.  Please use naming convention <method name>_<backend name>.

同一个输入法有不同后端支持的,可以为每一个后端写不同的设置文件。

> The name of alternative is xinput-<language name>.  (Please do not put
> encoding name such as EUC-JP or UTF-8).
> 
> In postinst, symbolic link is created as
> /etc/X11/xinit/xinput.d/<language name>.

这是比较复杂的那一部分。输入法 package 要在 postinst 里用 
alternative 系
统更新 /etc/X11/xinit/xinput.d/<语言名> 
这个符号链接。这里是不考虑编码的,
而且似乎对 scim 
这样的支持多种语言的输入法,就要做很多个符号链接。

> This setting is activated through /etc/X11/Xsession.d/90im-switch.  In
> this script, the user's ~/.xinput.d/<language name> is searched first.
> When it does not exist, /etc/X11/xinput.d/<language name> is
> searched. (There are more complication as seen in 90im-switch but
> please assume this for Debian). Based on the selected configuration
> file, XIM and IMmodule is set up and started.

最后通过 /etc/X11/Xsession.d/90im-switch 这个 X session script 
启动输入
法。90im-switch 会优先读取用户自己的 ~/.xinput.d/<语言名> 
的设置,如果找
不到,就读取 /etc/X11/xinit/xinput.d/<语言名>(我相信这里是 
Kenshi Muto
的笔误)的设置。

如果我没有记错,Osamu Aoki 曾经做过调查,/etc/X11/Xsession.d/ 
里的
script 应该是对直接 startx,gdm,kdm 和 xdm 都有效的。当然 
Debian 里还有
很多其他的 X Display manager,但是似乎 FreeDesktop 
有一个相关的标准,要
求都支持 /etc/X11/Xsession.d/。

我对这个架构还有不少不满意的地方,但这似乎是现有的最好架构。pnt
 你对
im-switch 有第一手的接触,有没有什么真知灼见?:-P

如果我有时间,我会和 pnt 合作实现 scim 对 im-switch 的支持。

Ming
2005.06.15


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

回复