SCIM

From Gentoo Linux Wiki

Jump to: navigation, search

SCIM is an input method that allows Linux users to input multiple languages.

Contents

[edit] Prerequisites

[edit] General

It is best to add the following USE flags in your /etc/make.conf file.

File: /etc/make.conf
...
# CJK
USE="${USE} scim unicode nls"

[edit] CJK (Chinese Japanese Korean)

If you are planning to input CJK, it is best that you add the following to your /etc/make.conf file.

File: /etc/make.conf
...
# CJK
USE="${USE} scim immqt-bc cjk unicode nls anthy m17n-lib"

After adding these USE flags do a simple update.

emerge -avuDN world

[edit] Setting the Locale

By default, Gentoo is set to POSIX. Since using SCIM means you are going to use Unicode characters, you must set your locale accordingly. The following command should print your locale.

locale

The output should be blank or say "POSIX" on each line unless you have already set your locale to something else.

[edit] System

To set your locale, first check your /etc/locale.gen file. You should have set this when you installed Gentoo. Specify your locales here. Check /usr/share/i18n/SUPPORTED to find what you have to put in for your language. Some examples are listed below.

File: /etc/locale.gen
...
# For United States English
en_US ISO-8859-1
en_US.UTF-8 UTF-8
# For German
de_DE ISO-8859-1
de_DE@euro ISO-8859-15
# For Chinese
zh_CN.GB18030 GB18030
zh_CN.GBK GBK
zh_CN.UTF-8 UTF-8
zh_CN GB2312
# For Japanese
ja_JP EUC-JP
ja_JP.EUC-JP EUC-JP
ja_JP.UTF-8 UTF-8
# For Korean
ko_KR EUC-KR
ko_KR.EUC-KR EUC-KR
ko_KR.UTF-8 UTF-8

After you are done here, generate the locales using the following command:

locale-gen
env-update; source /etc/profile

[edit] Environment

Edit the following as root to set the locale. Replace en_us.UTF-8 which your locale of choice.

File: /etc/env.d/02locale
...
LANG="en_US.UTF-8"
...

Then run

env-update; source /etc/profile

After doing this, make sure your locale was registered.

locale

[edit] Getting SCIM

Getting SCIM is as simple as emerging anything else. In the terminal:

[edit] Gnome / XFCE4

emerge -av scim scim-tables

[edit] KDE

Some SCIM front-end that you can choose in KDE sach as SKIM and SCIM-Bridge.

[edit] SKIM (for KDE3 and qt3)

The original SCIM front-end is for GTK+. There is a front end for KDE called SKIM.

emerge -av skim scim-tables scim-qtimm

[edit] SCIM-Bridge (for KDE4 and qt4)

But SKIM is not ready for KDE4 in this time (Sep. 8, 2009). SCIM-Bridge front-end is another choose in KDE4.

emerge -av scim-bridge

Use USE="-kde" for install scim-tables without install qt3. This package includes almost all CJK input methods.

USE="-kde" emerge -av scim-tables

[edit] CJK

To have any of these languages, simply emerge the components. You can of course have two or more of these at the same time.

[edit] Chinese

Some input methods can choose for Simplified Chinese language.

1. scim-pinyin (拼音)

emerge -av scim-pinyin

Some additional input methods can choose for Tranditional Chinese language by install gentoo-taiwan overlay.

emerge -av layman
layman -a gentoo-taiwan

1. scim-chewing (新酷音)

emerge -av scim-chewing

2. scim-array (行列30)

emerge -av scim-array

[edit] Japanese

emerge -av uim scim-uim scim-anthy

[edit] Korean

emerge -av scim-hangul

<math>Insert formula here</math>

[edit] Using SCIM

To let applications recognize SCIM as an input method, you have to export some variables. This can easily be accomplished by appending the following lines to /etc/profile.

[edit] GNOME or other GTK windows manager

File: /etc/profile
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim

[edit] KDE

For KDE (SKIM) do

File: /etc/profile
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=skim
export QT_IM_MODULE=skim

For KDE (SCIM-Bridge) do

File: /etc/profile
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=scim-bridge
export QT_IM_MODULE=scim-bridge
export QT4_IM_MODULE=scim-bridge

[edit] xinitrc

If you wish to have scim start automatically when you login add it to your ~/.xinitrc file.

For GTK

File: ~/.xinitrc
scim -d &

For KDE

File: ~/.xinitrc
skim -d &

[edit] Tada

Now restart your computer to make sure all variables are loaded, then press ctrl+space to see the magic.

[edit] References

Personal tools