Sunday, February 05, 2006

Chinese input as if I were in Windows

Finally, get one solution. I like the English UI as I feel it is weird if the interface in Linux is displayed as chinese.

The following contains the text for reference only. The original page is:

Ubuntu CJK Chinese Japanese Korean Input Guide

Ubuntu 5.04 Hoary SCIM Chinese, Japanese, and Korean Input Guide
You can install CJK input via ubuntuaddon or do it via internet.
Ubuntu already comes with Chinese, Japanese and Korean fonts preinstalled.

To install via internet (universe repositories must be enabled)
sudo apt-get install uim anthy scim-gtk2-immodule scim-uim scim-chinese scim-hangul scim-tables-zh scim-tables-ja scim-tables-ko

Add SCIM to startup for X11
sudo touch /etc/X11/Xsession.d/74custom-scim_startup
sudo chmod 646 /etc/X11/Xsession.d/74custom-scim_startup
echo 'export XMODIFIERS="@im=SCIM"' >> /etc/X11/Xsession.d/74custom-scim_startup
echo 'export GTK_IM_MODULE="scim"' >> /etc/X11/Xsession.d/74custom-scim_startup
echo 'export XIM_PROGRAM="scim -d"' >> /etc/X11/Xsession.d/74custom-scim_startup
echo 'export QT_IM_MODULE="scim"' >> /etc/X11/Xsession.d/74custom-scim_startup
sudo chmod 644 /etc/X11/Xsession.d/74custom-scim_startup

Press CTRL-SPACE to bring up SCIM input methods.

Next two steps are OPTIONAL (scim KDE startup and input KDE apps while in GNOME)

If you installed kubuntu-desktop (KDE) and plan on logging into KDE session do this in terminal
sudo touch ~/.kde/Autostart/startscim
echo '"#!/bin/sh"' >> ~/.kde/Autostart/startscim
echo "scim -d" >> ~/.kde/Autostart/startscim
sudo chmod 745 ~/.kde/Autostart/startscim

While using GNOME:
you can input into GNOME, GTK apps but NOT KDE apps.

While using KDE you can input GNOME, GTK and KDE apps.
So if you want to also input in KDE apps while using GNOME do the following:
sudo touch ~/.gnome2/session-manual
echo "[Default]" >> ~/.gnome2/session-manual
echo "num_clients=1" >> ~/.gnome2/session-manual
echo "0,RestartStyleHint=3" >> ~/.gnome2/session-manual
echo "0,Priority=50" >> ~/.gnome2/session-manual
echo "0,RestartCommand=scim -d" >> ~/.gnome2/session-manual
echo "0,Program=scim" >> ~/.gnome2/session-manual

This will create two SCIM keyboards under GNOME though but allows you to input in KDE apps while in GNOME.

No comments: