2007/07/03

[Linux] 輸入法的設定

// 我習慣先說一大堆再來實作,所以不看的人,請按 END

其實現在的 (至少fc5以後), ubuntu 6.10 以後都已經實做了 im-switch, 所以 exportXMODIFIERS 跟 GTK_IM_MODULE 的做法有時反而造成負擔。

im-switch 的做法是:
建立 ~/.xinput.d/ 在底下依據 locale (如 zh_TW, zh_CN 建立備份及目前使用的輸入法) 的目錄,用這個目錄來存輸入法設定的資料。 如此,可以在同一個 wm 底下開一個日文 console 時用日文輸入法 (ex: kinput),開繁中用 gcin/oxim/scim, 開簡中用 scim/拼音 等等,不必強求一個輸入法要滿足各種語言上的功能需求。


im-swicth 使用說明:
1. 列出目前可以使用的輸入法及預設設定:

im-switch -l
// 預設使用
=======================================================
The configuration "/home/anton/.xinput.d/zh_TW" is defined as a link pointing
tooxim
This private configuration supersedes the system wide default.
// 系統預設使用
=======================================================
The system wide default is pointed by "/etc/alternatives/xinput-zh_TW" .
xinput-zh_TW - status is auto.
link currently points to scim-chewing
scim-chewing - priority 50
scim - priority 50
scim-immodule - priority 0
Current `best' version is scim-chewing.

// 可用列表
=======================================================
The available input method configuration files are:
default none oxim scim scim-chewing scim-immodule scim_xim th-xim

設定方式:


im-switch [-v][-z ll_CC] -s inputmethodname

例如:

$ im-switch -s scim-immodule (將使用 scim 的 immodule 輸入法)
(default 設到目前使用的 locale)
$ im-switch -z zh_CN -s oxim (將 oxim 設到 zh_CN 時使用的輸入法)


以上,所以在沒有 export 前文提到的 XMODIFIERS 跟 GTK/QT_IM_MODULE 時,用 im-switch 是沒有太大的問題的,但是如果有在 .bashrc 底下做時,開新的 console 就要小心一下。

沒有留言:

[Windows] git-bash 底下的工具

因為工作轉到 Windows 平台上的關係,所以很多工具改到 Windows 上面運作,跟著在 TortoiseGit 底下使用 git-bash 來維護自己的專案原始碼。結果就是裝了前面提過的 auto-hotkey 使用熱鍵來提昇自己的平台操作速度; 但除了 hotkey...