網管技術
Ubuntu安裝中文輸入法
September 28, 2015Otherubuntu, 中文輸入法
若使用者安裝的是非中文語系的Ubuntu,使用ibus時,預設的中文輸入法只有注音和拼音;想用其它中文輸入法,需要使用者自己安裝(這裡以倉頡為例):
在terminal(ctrl+alt+t)中輸入下列指令來安裝快倉
sudo apt-get install ibus-table-scj6
ibus-table-xxx即為各種中文輸入法,如scj6為快倉、cangjie3為倉頡3(也就是微軟的新倉頡)、cangjie5為倉頡5、quick為速成輸入法……

安裝好後,終於可以使用我們心愛的輸入法了^^,但這時候你可能會遇到一個情況,就是同一個字,同樣的碼,以前打的出來,怎麼現在打不出來了呢!這是因非正體中文的ubuntu其ibus預設中文語係為簡體中文>_<a,我們要將其改為正體中文才可!
編輯」/usr/share/ibus-table/engine/table.py「此檔案,檔案中有註解,說明各數字代表的語系。
# self._chinese_mode: the candidate filter mode,
# 0 is simplify Chinese
# 1 is traditional Chinese
# 2 is Big charset mode, but simplify Chinese first
# 3 is Big charset mode, but traditional Chinese first
# 4 is Big charset mode.
# we use LC_CTYPE or LANG to determine which one to use
找到下面這段(大約在第124行),將if區塊裡的return值從0改成1
if self.db._is_chinese:
#if IME declare as Chinese IME
return 1
else:
return -1
修改完存檔後, 退出ibus再重啟就ok囉!
Reference: http://notebuntu.blogspot.tw/