Setup multilingual Japanese environment for non-gtk apps in Gnome

Due to some annoyances with scim, the Ubuntu default input system, and due to my own personal preference for uim, the first thing I usually do on a fresh Ubuntu install is remove all support for scim, and install uim-gtk. However, this leaves me without Japanese input for the occasional KDE or QT application. This is where uim-xim comes in. The uim-xim package README indicates this is only a temporary workaround to enable input for applications that are without direct uim support, but it’s good enough for me until there’s a usable qt-uim package. I’ll describe what I did for konqueror. Let’s assume you’ve just installed Ubuntu or Debian. All packages mentioned are included in the Ubuntu and Debian releases I’ve tried.

First, open synaptic, adept, (or dselect, for all I care) and search scim and skim. Remove any packages that turn up. don’t worry about removing package ubuntu-desktop, since it’s only a meta-package to bring in the basic desktop applications, of which scim is one. I also usually dump canna, skk, or whatever other server based CJK input systems if they are present. I recommend anthy for its elegance and ease of use. Next, install uim-gtk2.0, uim-anthy, and uim-applet-gnome, which should bring in any required dependencies.

Moving right along, in a Gnome session, add uim panel applet, or simply start it from the command line or alt-f2, and make sure it becomes part of your session. The next thing to do is set up how you want to activate anthy input via uim. That is, by keystrokes, using the gui or a combination thereof. This might require a few quick log out and log back ins to make sure your changes are activated upon system start. Most users will want custom defaults, so I won’t go into too much detail here. My standard approach is to have Gnome use all English for menus and input, and if I need to do a bunch of Japanese input, I switch to uim-anthy via the gui applet. Once activated, I can switch between Japanese and English input by hitting shift-space. If I want to go back to all English, I de-activate anthy by selecting direct input in the panel applet.

This is all fine if you only use gtk applications, but what about with kde or other non-gtk programs? That’s where uim-xim comes in. This should work for kmail, konqueror, or any other program with xim support. First, install uim-xim. Next, write a simple script to do complete several actions required for the uim-xim bridging. This is my konqueror script, which I saved as kanjikonq in nano:

uim-xim -engine=anthy &
XMODIFIERS=@im=uim konqueror

After running chmod +x on the script, I add a launcher for konqueror to my panel, and change the run command to the kanjikonq script. Clicking the customized panel icon opens up konqueror in Japanese input mode. Hitting shift-space cycles between roman and kanji input. I can also turn off anthy completely, via ctrl-space, if I need to do a bunch of English input. This is all configurable in the uim-gtk panel applet preferences dialog. I tried opening multiple instances of konqueror with this script and it looks like uim-xim is only started once, the first time you run the script, so no unnecessary duplicate processes will be running.

So, there you have it. A relatively simple way to deal with Japanese (or any other CJK) input for a multilingual desktop that’s not limited to a single desktop environment.


Author: iamacat

Writer Having studied Japanese and other non-roman alphabet using languages, I appreciate the particular frustrations of language learners in the computer world. I enjoy helping people get their multilingualization going, no matter what operating system or desktop environment they happen to be in. Being an open source enthusiast, I push uim and anthy without reservation in *nix environments. Although lately, ibus has made things easy in modern Linux distributions, to the point of making much of these old posts moot.

5 thoughts on “Setup multilingual Japanese environment for non-gtk apps in Gnome”

  1. じゃあ、このページは有用よ。ありがとうございました。




  2. Well, this page was helpful. Thanks very much.

    Erm, isn’t [我輩] a bit arrogant? :p haha

    haha, My Japanese is very unskilled isn’t it…. 😦



    (Yeah, I wrote in English as well. Whatcha gonna do?)

  3. Glad it helped. I’ve done some follow ups with more detail in recent months. Always planning more, so check back. Re: 「我輩」: Check out Soseki’s story of the same name (as the blog). Funny stuff. And be careful using words that have a「ko」sound and [man」right next to each other. The homonymic possibilites could be obscene. Probably just plain old 「偉そう」works for that meaning.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s