[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

im-switch framework proposal



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Today I did ITP im-switch package, to make switching input method or
defining a default more easy.

Here is a proposal for input method maintainers and users.
Any comments are welcome.

(This proposal is translated by Osamu Aoki, Thank you.)
- -------------------------------------------------------------
im-switch framework proposal

im-swich is the input method (IM) framework partially ported from
FedraCore to Debian.

Debian offers multiple backend input methods (XIM, IMmodule, ...).
Due to this freedom of choice, there is no easy choice for the default
input method and each end user was required to edit environment
varriables and configuration files such as ~/.xsession.

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.

Current tentative packages for im-switch can be obtained by including
following lines to your /etc/apt/sources.list:

deb http://kmuto.jp/debian/mtu unstable main
deb-src http://kmuto.jp/debian/mtu unstable main

(Since there are many other unrelated packages, you should remove
these lines once you install im-switch.)

Then you run "sudo apt-get install im-switch".

There are updated uim (needs uim-xim~uim-
gtk2.0), skkinput, kinput2, atokx2 (iiimgcf) which incorporated im-switch
framework for sample implementation.

Development version is available under svn and accessible anonymously.

svn checkout http://kmuto.jp/svn/im-switch/trunk im-switch

* List of all available IM.: im-switch -l

$ im-switch -l
You have ja_JP setup in "/home/kmuto/.xinput.d".
=======================================================
xinput-ja_JP - status is manual.
 link currently points to skkinput
kinput2-canna-wnn_canna - priority 60
kinput2-canna-wnn_wnn - priority 50
none - priority 10
skkinput - priority 50
uim_anthy - priority 50
uim_skk - priority 50
uim_prime - priority 50
uim_canna - priority 60
Current `best' version is kinput2-canna-wnn_canna.
=======================================================
The following languages currently have input methods configured:
ja_JP

* Change default IM across system: under root privilege,
  "im-switch -s <IM name>"

# im-switch -s uim_skk
Using `/etc/X11/xinit/xinput.d/uim_skk' to provide `xinput-ja_JP'.

* Change IM for a user: under non-user privilege,
 "im-switch -s <IM name>"

$ im-switch -s uim_skk

If you select "none", im-switch will be disabled, i.e., no setting is
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:

XIM=kinput2                                <- The value for XMODIFIERS=@im=
XIM_PROGRAM=/usr/X11R6/bin/kinput2-canna   <- Full path of the program started for XIM
XIM_ARGS="+xim"                            <- Argument for XIM
GTK_IM_MODULE=                             <- The value for IMmodule used by GTK+
DEPENDS=canna                              <- The package name which this IM requires

If the value is empty, that parameter is not used. DEPENDS can lists
multiple packages using ","(require both packages) or "|" (require
either packages).  This DEPENDS does not auto install these packages
but im-switch issues warning when these are not available.

This is Bourne Shell script.  You can write program or export
environment variables.  Be careful on bashism.  You should check script
under dash.

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

You register alternative in postinst of the package as:

update-alternatives \
        --install /etc/X11/xinit/xinput.d/ja_JP xinput-ja_JP \
        /etc/X11/xinit/xinput.d/kinput2-canna 60

You remove alternative in prerm of the package as:

update-alternatives --remove xinput-ja_JP /etc/X11/xinit/xinput.d/kinput2-canna

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>.

Here, priority is set to 60.  Tentative policy for priority is:

    * 60: Default backend
    * 50: Standard priority
    * 10: reserved for none (No action)
    * <10: Experimental IM (Not recommended for the end users)

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.

* Development Team
- - Kenshi Muto
- - Akira TAGOH
- - Masanori GOTO
- -------------------------------------------------------------
- -- 
Kenshi Muto
kmuto@debian.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAkKgrOoACgkQQKW+7XLQPLHDuwCcDGiq4c8bq31GaBj2cTixAhmS
BCUAniRXKf9Cyodl681Y8ZsiXvhCrOI/
=iff2
-----END PGP SIGNATURE-----



Reply to: