Difference between revisions of "Smart Common Input Method platform"

From ArchWiki
Jump to: navigation, search
(Steps for KDE with kdm)
m (Note for GNOME, Xfce, LXDE: out of date)
(41 intermediate revisions by 20 users not shown)
Line 1: Line 1:
[[Category:Internationalization (English)]]
+
[[Category:Internationalization]]
[[Category:HOWTOs (English)]]
+
[[ja:Smart Common Input Method platform]]
 +
[[zh-CN:Smart Common Input Method platform]]
 +
[[zh-TW:Smart Common Input Method platform]]
 +
{{Article summary start}}
 +
{{Article summary text|This article discusses the installation, configuration, and troubleshooting steps associated with the usage of SCIM, the Smart Common Input Method.}}
 +
{{Article summary heading|Related}}
 +
{{Article summary wiki|IBus}}
 +
{{Article summary wiki|UIM}}
 +
{{Article summary end}}
  
{{i18n_links_start}}
+
{{Out of date}}
{{i18n_entry|简体中文|SCIM中文输入法}}
+
{{Poor writing}}
{{i18n_entry|正體中文|SCIM中文輸入法}}
+
{{i18n_links_end}}
+
  
= About SCIM =
+
[[Wikipedia:Smart Common Input Method|SCIM]] is an input method framework developed by Su Zhe (or James Su) around 2001, similar to [[IBus]] or [[UIM]].
Su Zhe (or James Su)-who at that time worked for TurboLinux- started this project about 2001 with the goal:
+
 
* Act as an unified frontend for current available input method libraries. Currently bindings to uim and m17n library are available.
+
Its stated goals are to:
* Act as a language engine of IIIMF input method framework (TBD).
+
* Act as an unified front-end for current available input method libraries. Currently bindings to [[UIM]] and [http://www.m17n.org/m17n-lib-en/ m17n] library are available.
* Provide as many native IMEngines as possible.
+
* Act as a language engine of [[Wikipedia:Internet/Intranet Input Method Framework|IIIMF]] input method framework.
* Support as many input method protocol/interface as possible.
+
* Provide as many native [http://www.scim-im.org/projects/imengines IMEngines] as possible.
 +
* Support as many input method protocols/interfaces as possible.
 
* Support as many operating systems as possible.
 
* Support as many operating systems as possible.
  
SCIM has the following features:
+
Nowadays, SCIM is also:  
* Fully Object Oriented structure written in C++.
+
 
* Highly modularized.
 
* Highly modularized.
* Very flexible architecture, can be used as a dynamically loaded library as well as a C/S input method environment.
+
* Very flexible in its architecture, it can be used as a dynamically loaded library as well as a C/S input method environment.
* Simple programming interface.
+
* Simple from a programming interface perspective.
* Fully i18n support with UCS-4/UTF-8 encoding.
+
* Fully i18n enabled with support for UCS-4/UTF-8 encoding.
* Include many handy utility functions to speedup the development.
+
* Easy to configure through its unified configuration framework.
* GUI Panel with very rich features.
+
* Unified configuration framework.
+
  
= Installing SCIM =
+
== Installing SCIM ==
# pacman -S scim
+
SCIM can be [[Pacman|installed]] with the package {{Pkg|scim}}, available in the [[official repositories]].
== Installing Input Method Engines ==
+
Currently the SCIM project has a wide range of input methods (some may need other libraries), covering more than 30 languages, including (Simplified/Traditional) Chinese, Japanese, Korean and many European languages.
+
These are some of the examples (more can be found [http://www.scim-im.org/projects/imengines here]):
+
  
Chinese Smart PinYin:
+
=== Installing Input Method Engines ===
# pacman -S scim-pinyin
+
Currently the SCIM project has a wide range of input methods (some may need other libraries), covering more than 30 languages, including (Simplified/Traditional) Chinese, Japanese, Korean and many European languages. These are some of the examples (more can be found [http://www.scim-im.org/projects/imengines here]):
Chinese WuBi or other tables based:
+
# pacman -S scim-tables
+
Japanese:
+
# pacman -S scim-anthy
+
Korean:
+
# pacman -S scim-hangul
+
  
= Configure SCIM =
+
* '''Chinese Smart PinYin''': {{Pkg|scim-pinyin}}.
 +
* '''Chinese WuBi or other tables based''': {{Pkg|scim-tables}}.
 +
* '''Japanese''': {{Pkg|scim-anthy}}.
 +
* '''Korean''': {{Pkg|scim-hangul}}
  
Add the following lines to ~/.xinitrc before executing your DE/WM. If you want all the users of your system to use scim, place these lines in your /etc/profile.
+
== Configure SCIM ==
 +
Configuring SCIM correctly requires the following three steps:
 +
# Exporting some environment variables that specify the used input method.
 +
# Modifying locale related files.
 +
# Finally, starting SCIM.
  
export XMODIFIERS=@im=SCIM
+
=== A Simple scenario ===
export GTK_IM_MODULE="scim"
+
export QT_IM_MODULE="scim"
+
scim -d 
+
  
If you use  "scim -f socket -c socket -d" instead of
+
If you just need SCIM to work urgently in any Desktop Environment or Window Manager, put these lines into {{ic|/etc/xprofile}} or {{ic|~/.xprofile}} and then reboot:
"scim -d ",you cannot use scim in some qt program,
+
{{hc|~/.xprofile|<nowiki>
like eva .
+
export XMODIFIERS=@im=SCIM
 +
export GTK_IM_MODULE="scim"
 +
export QT_IM_MODULE="scim"
 +
scim -d</nowiki>
 +
}}
  
 +
These lines can be added to other files that are run at startup, such as: {{ic|/etc/profile}}, {{ic|~/.profile}}, {{ic|~/.xinitrc}} or {{ic|~/.config/openbox/autostart}} (when using [[Openbox]]).
  
This is what your .xinitrc file should look like. Note that the "exec ''DE/WM''" line comes '''after''' the lines for SCIM
+
{{Note|The first environment variable conflicts with some (unusual) options like {{ic|1=XMODIFIERS=urxvt}}.}}
  
#!/bin/sh
+
This is a very basic example for configuring XIM (X Input Method) to work with SCIM. XIM is not recommended because it has quite some limitations.
+
#
+
# ~/.xinitrc
+
#
+
# Executed by startx (run your window manager from here)
+
#
+
+
# exec wmaker
+
# exec startkde
+
# exec icewm
+
# exec blackbox
+
# exec fluxbox
+
+
# SCIM
+
export XMODIFIERS=@im=SCIM
+
export GTK_IM_MODULE="scim"
+
export QT_IM_MODULE="scim"
+
scim -d
+
+
exec gnome-session
+
  
If after you have install scim and the necessary input tables, and scim still doesn't work (click on the system tray, and nothing pops up), then you need to set the '''LC_CTYPE''' environmental variable in '''/etc/profile''' to the locale you plan to use. Simply create an entry for LC_CTYPE in /etc/profile, if there isn't one.
+
=== Note for GTK+ ===
  
eg.   LC_CTYPE="zh_CN.utf8"             //if you want to type simplified chinese
+
If you use [[GNOME]], edit {{ic|/etc/gtk-2.0/gtk.immodules}} by adding follow content at the end:
 +
{{hc|/etc/gtk-2.0/gtk.immodules|
 +
"/usr/lib/gtk-2.0/immodules/im-scim.so"
 +
"scim" "SCIM Input Method" "scim" "/usr/share/locale" "ja:ko:zh"
 +
}}
  
Finally you need to generate the locale using the locale-gen command. Modify the /etc/locale.gen file to uncomment the language and encoding set you wish to use scim with. Then run the following command to generate the locale for your system.
+
If your {{ic|LC_CTYPE}} or {{ic|LANG}} is ''en_US.UTF-8'', change {{ic|ja:ko:zh}} to {{ic|en:ja:ko:zh}}.  
  
locale-gen
+
After making those changes, be sure to reboot. You can find out what input method modules are available on your system by executing {{ic|gtk-query-immodules-2.0}}.
  
To get scim working for me, I had to additionally add my current locale to /etc/scim/global (~/.scim/global should work too probably). Change the first line to include your locale. In my case it looks like this now:
+
If SCIM does not work with GTK+ applications after these changes, check that the GTK_IM_MODULE_FILE environment variable is set to {{ic|/etc/gtk-2.0/gtk.immodules}}.
 +
 
 +
You can use another file (in this example {{ic|~/.immodules}}) that contains the necessary information about input methods modules by adding these lines in the file you selected in the [[#A simple scenario|section above]].
 +
gtk-query-immodules-2.0 > ~/.immodules
 +
export GTK_IM_MODULE_FILE=~/.immodules
 +
 
 +
==== Note for aMSN users ====
 +
You must also export the following variable to be able to use scim input with aMSN.
 +
export XIM_MODULE="scim -d"
 +
 
 +
==== Note for GNOME, Xfce, LXDE ====
 +
 
 +
{{Out of date|The package {{ic|scim-bridge}} does not exist anymore.}}
 +
 
 +
If you are using GNOME, Xfce or LXDE and Qt applications do not pick up the {{ic|1=export QT_IM_MODULE="scim"}} variable, you can use {{AUR|scim-bridge}} from the [[AUR]]. To use ''scim-bridge'' instead, export the following:
 +
export QT_IM_MODULE="scim-bridge"
 +
 
 +
==== Note for KDE3 ====
 +
 
 +
For KDE3 you should {{ic|export QT_IM_MODULE&#61;"xim"}} instead of ''scim'' and also install [http://www.scim-im.org/projects/scim_qtimm qtimm]] for Qt3.
 +
 
 +
=== Locale-related files ===
 +
 
 +
If your keyboard locale is not {{ic|en_US.UTF-8}} (or {{ic|en_US.utf8}}), you have to modify the first line of {{ic|~/.scim/global}} (or {{ic|/etc/scim/global}} to apply these settings to all users) according to the following example:
  
 
  /SupportedUnicodeLocales = en_US.UTF-8,de_CH.UTF-8
 
  /SupportedUnicodeLocales = en_US.UTF-8,de_CH.UTF-8
  
== Configure SCIM for GNOME with gdm ==
+
and replace your {{ic|de_CH.UTF-8}} with your locale.
This method seems to work with GNOME when logging in through gdm.
+
  
1. Install ''scim'' and the relative input methods through pacman
+
{{Note|Your locale has to be active (i.e. you have to uncomment it in {{ic|/etc/locale-gen}} and then execute {{ic|locale-gen}} as root) ''and'' has to be supported by SCIM (most *.UTF-8 locales are).}}
  
2. Insert the following lines at the end of your /etc/profile
+
If you do not know which locales you have active at the moment, you can check it:
  
  export XMODIFIERS=@im=SCIM
+
  locale -a
export GTK_IM_MODULE="scim"
+
export QT_IM_MODULE="scim"
+
  
3. In your GNOME desktop, go to System > Preferences > Session and create a new command with the following line:
+
(alternatively you can look at {{ic|/etc/locale.gen}}).
  
scim -f x11 -c simple -d
+
==== Further troubleshooting with locales ====
  
4. Restart your machine and enjoy!
+
If after you have install SCIM and the necessary input tables, SCIM still does not work, then you need to set the {{ic|LC_CTYPE}} environmental variable in {{ic|/etc/profile}} to the locale you plan to use. Simply create an entry for LC_CTYPE such as:
 +
LC_CTYPE="zh_CN.UTF-8"              # if you want to type simplified chinese
  
Note: I tried to put the first three lines in my .xinitrc instead of /etc/profile, but it didn't work for me.
+
Finally you need to generate the locale using the {{ic|locale-gen}} command.
 +
 
 +
=== Executing SCIM ===
 +
 
 +
SCIM can be run by just executing the {{ic|scim}} command, although it is common to start SCIM as a daemon:
 +
scim -d
  
Note: If you use the line  scim -f socket -c socket -d instead, the configuration of your SCIM will be unmodifiable.
+
You can put the above command in a script file and execute it automatically. Usual places are {{ic|~/.xinitrc}} (after environment variables and before DE/WM), {{ic|/etc/profile}} (after environment variables) or {{ic|~/.config/openbox/autostart}} (after environment variables and possibly after some sleep command).
  
== Steps for KDE with kdm ==
+
==== Note for GNOME ====
This method seems to work with KDE when logging in through kdm.
+
  
1. Install '''scim''' and input engines.
+
In case you use GNOME as your desktop environment, the command above does not seem to work as expected. Instead, you have to execute the following:
  
2. Create a new file called .xprofile in your home folder (~/.xprofile) and add the following lines:
+
  scim -f x11 -c simple -d
export XMODIFIERS=@im=SCIM
+
export GTK_IM_MODULE=scim
+
export QT_IM_MODULE=scim
+
scim -f socket -c socket -d
+
If you want all the users of your system to use scim, place these lines in your /etc/profile instead.
+
  
Steps after this one are optional.
+
If you want SCIM to start automatically at startup, go to System > Preferences > Session and create a new command with the line above.
3. Install '''skim''' from the [http://aur.archlinux.org/packages.php?ID=22652 AUR].
+
  
4. Start '''SKIM''', right click on the system tray icon and click 'Configure'
+
{{Note| If you use the line {{ic|scim -f socket -c socket -d}} instead, the configuration of your SCIM will be unmodifiable.}}
  
5. Under '''Frontend > X Window''', tick the checkbox for "Start skim automatically when KDE starts"
+
==== Note for KDE ====
  
6. Logout and restart X server (ctrl+alt+del), then login again
+
In case you use KDE as a desktop environment, the command above does not seem to work as expected. Instead, you have to execute the following:
 +
  scim -f socket -c socket -d
  
In any application, press ''ctrl+space'' to activate the input window.
+
== Bugs ==
  
 +
=== LWJGL (Lightweight Java Game Library) losing keyboard focus ===
  
 +
See [http://www.scim-im.org/forums#nabble-td2499750 these] [http://ubuntuforums.org/showthread.php?t=1641861 two] forum posts for a solution.
  
[http://www.archlinux.org/news/166/ See the official news page for more details].
+
== Links ==
 +
*[https://www.archlinux.org/news/166/ See the official news page for more details].

Revision as of 10:07, 3 November 2013

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary end

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Smart Common Input Method platform#)

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Smart Common Input Method platform#)
SCIM is an input method framework developed by Su Zhe (or James Su) around 2001, similar to IBus or UIM.

Its stated goals are to:

  • Act as an unified front-end for current available input method libraries. Currently bindings to UIM and m17n library are available.
  • Act as a language engine of IIIMF input method framework.
  • Provide as many native IMEngines as possible.
  • Support as many input method protocols/interfaces as possible.
  • Support as many operating systems as possible.

Nowadays, SCIM is also:

  • Highly modularized.
  • Very flexible in its architecture, it can be used as a dynamically loaded library as well as a C/S input method environment.
  • Simple from a programming interface perspective.
  • Fully i18n enabled with support for UCS-4/UTF-8 encoding.
  • Easy to configure through its unified configuration framework.

Installing SCIM

SCIM can be installed with the package scim, available in the official repositories.

Installing Input Method Engines

Currently the SCIM project has a wide range of input methods (some may need other libraries), covering more than 30 languages, including (Simplified/Traditional) Chinese, Japanese, Korean and many European languages. These are some of the examples (more can be found here):

Configure SCIM

Configuring SCIM correctly requires the following three steps:

  1. Exporting some environment variables that specify the used input method.
  2. Modifying locale related files.
  3. Finally, starting SCIM.

A Simple scenario

If you just need SCIM to work urgently in any Desktop Environment or Window Manager, put these lines into /etc/xprofile or ~/.xprofile and then reboot:

~/.xprofile
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"
scim -d

These lines can be added to other files that are run at startup, such as: /etc/profile, ~/.profile, ~/.xinitrc or ~/.config/openbox/autostart (when using Openbox).

Note: The first environment variable conflicts with some (unusual) options like XMODIFIERS=urxvt.

This is a very basic example for configuring XIM (X Input Method) to work with SCIM. XIM is not recommended because it has quite some limitations.

Note for GTK+

If you use GNOME, edit /etc/gtk-2.0/gtk.immodules by adding follow content at the end:

/etc/gtk-2.0/gtk.immodules
"/usr/lib/gtk-2.0/immodules/im-scim.so"
"scim" "SCIM Input Method" "scim" "/usr/share/locale" "ja:ko:zh"

If your LC_CTYPE or LANG is en_US.UTF-8, change ja:ko:zh to en:ja:ko:zh.

After making those changes, be sure to reboot. You can find out what input method modules are available on your system by executing gtk-query-immodules-2.0.

If SCIM does not work with GTK+ applications after these changes, check that the GTK_IM_MODULE_FILE environment variable is set to /etc/gtk-2.0/gtk.immodules.

You can use another file (in this example ~/.immodules) that contains the necessary information about input methods modules by adding these lines in the file you selected in the section above.

gtk-query-immodules-2.0 > ~/.immodules
export GTK_IM_MODULE_FILE=~/.immodules

Note for aMSN users

You must also export the following variable to be able to use scim input with aMSN.

export XIM_MODULE="scim -d"

Note for GNOME, Xfce, LXDE

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: The package scim-bridge does not exist anymore. (Discuss in Talk:Smart Common Input Method platform#)

If you are using GNOME, Xfce or LXDE and Qt applications do not pick up the export QT_IM_MODULE="scim" variable, you can use scim-bridgeAUR from the AUR. To use scim-bridge instead, export the following:

export QT_IM_MODULE="scim-bridge"

Note for KDE3

For KDE3 you should export QT_IM_MODULE="xim" instead of scim and also install qtimm] for Qt3.

Locale-related files

If your keyboard locale is not en_US.UTF-8 (or en_US.utf8), you have to modify the first line of ~/.scim/global (or /etc/scim/global to apply these settings to all users) according to the following example:

/SupportedUnicodeLocales = en_US.UTF-8,de_CH.UTF-8

and replace your de_CH.UTF-8 with your locale.

Note: Your locale has to be active (i.e. you have to uncomment it in /etc/locale-gen and then execute locale-gen as root) and has to be supported by SCIM (most *.UTF-8 locales are).

If you do not know which locales you have active at the moment, you can check it:

locale -a

(alternatively you can look at /etc/locale.gen).

Further troubleshooting with locales

If after you have install SCIM and the necessary input tables, SCIM still does not work, then you need to set the LC_CTYPE environmental variable in /etc/profile to the locale you plan to use. Simply create an entry for LC_CTYPE such as:

LC_CTYPE="zh_CN.UTF-8"              # if you want to type simplified chinese

Finally you need to generate the locale using the locale-gen command.

Executing SCIM

SCIM can be run by just executing the scim command, although it is common to start SCIM as a daemon:

scim -d

You can put the above command in a script file and execute it automatically. Usual places are ~/.xinitrc (after environment variables and before DE/WM), /etc/profile (after environment variables) or ~/.config/openbox/autostart (after environment variables and possibly after some sleep command).

Note for GNOME

In case you use GNOME as your desktop environment, the command above does not seem to work as expected. Instead, you have to execute the following:

 scim -f x11 -c simple -d

If you want SCIM to start automatically at startup, go to System > Preferences > Session and create a new command with the line above.

Note: If you use the line scim -f socket -c socket -d instead, the configuration of your SCIM will be unmodifiable.

Note for KDE

In case you use KDE as a desktop environment, the command above does not seem to work as expected. Instead, you have to execute the following:

 scim -f socket -c socket -d

Bugs

LWJGL (Lightweight Java Game Library) losing keyboard focus

See these two forum posts for a solution.

Links