AnimeSuki Forums

Register Forum Rules FAQ Members List Social Groups Search Today's Posts Mark Forums Read

Go Back   AnimeSuki Forum > Support > Tech Support


Thread Tools
Old 2010-11-23, 17:36   Link #1
Join Date: Dec 2005
Location: New Zealand
Japanese text input on Linux

I've recently switched from XP to Debian (lenny), and I'm a bit confused about which Japanese input method to install. I've been running Linux servers for years but I'm pretty much a n00b when it comes to penguin love on the desktop.

Reading around I gather I need two, maybe three, bits of software:
  1. An input server to do the XIM stuff and handle the user interface, e.g. to provide the composition (pre-edit) window and kanji selection menu
  2. A conversion server to manage the kana-to-kanji lookup and feed candidates back to the input server (chapter 11 of the Xlib Programming Manual calls this the "translation server", but I find that term misleading)
  3. Optionally, some sort of input method manager (this would correspond to the IMM and language bar on Windows, just as the first two components collectively equate to what Windows calls an IME)
The choices seem to be the kinput2 input server with either Canna or FreeWnn as the conversion back-end, or the SCIM input server with Anthy for conversion (plus appropriate glue). Both appear to be widely used, but I get the impression from Google and chapter 5 of the Blowfish that the kinput2 back-ends aren't as actively maintained. What would other AnimeSuki readers recommend?

To clarify, my needs are pretty simple: I'm just your basic weeaboo, it's not like I'm writing scholarly articles in Japanese (but everyone knows that a bit of 日本語 makes your posts more 可愛い , just like gratuitous Latinisms add gravitas). I detest bloatware, which is why I chose IceWM over Gnome or KDE, and would sooner live with the odd inconvenience than install a bucket-load of packages I don't really need. Emacs integration would be nice to have, and the final wrinkle is that I'd like the IM to support my Japanese keyboard (MS Comfort Curve 2000, JIS layout - hey, it cost me 3000 in Akiba compared to 10-15k for the home-grown models I saw).

Any suggestions or pointers gratefully received

P.S. For anyone who stumbles across this thread in the future, here's how I set up my Japanese keyboard for standard ASCII input (thought I'd mention it since it took a bit of research).

For basic text-mode (non-X) support I ran dpkg-reconfigure console-data and chose "pc / qwerty / Japanese / PC 110". The only slight annoyance is that I have to type Shift-zero to get a tilde instead of Shift-^ (/usr/share/keymaps/i386/qwerty/jp106.kmap.gz has the correct mapping, but it's wrong in /etc/console/boottime.kmap.gz - or rather, the latter file matches the layout I linked to above, but not my keyboard or the one shown on p333 of the Blowfish).

And here's my /etc/X11/xorg.conf keyboard setup:
Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
    # Add JP106 support
    Option         "XkbRules" "xorg"
    Option         "XkbModel" "jp106"
    Option         "XkbLayout" "jp"
    # Handle Yen key correctly
    Option         "XkbVariant" "OADG109A"
    # End of JP106 mods
The option values are taken from this thread, after reading the kbd(4) manpage and playing around with setxkbmap. xev now shows the correct keysyms being generated by the JP-specific keys (e.g. Zenkaku_Hankaku), but obviously they don't do anything without an IM running.
And what rough beast, its hour come round at last,
Slouches towards Akihabara to be born?

Last edited by Simon; 2010-11-29 at 19:26. Reason: Typos
Simon is offline   Reply With Quote
Old 2010-11-23, 20:30   Link #2
Also a Lolicon
Join Date: Apr 2010
I personally use SCIM and Anthy. It works great in openSUSE, it should with Ubuntu.
Random32 is offline   Reply With Quote
Old 2010-11-29, 19:51   Link #3
Join Date: Dec 2005
Location: New Zealand
Originally Posted by Random32 View Post
I personally use SCIM and Anthy. It works great in openSUSE, it should with Ubuntu.

I also went with SCIM and Anthy, and you're right, they're a pretty slick combo. I had a moment of confusion when I couldn't activate SCIM by pressing Ctrl-Space or clicking the keyboard icon, but then I worked out that unlike on Windows you have to click in a text entry field first. D'oh!

Anthy works great with the Japanese keyboard, too.

Since most of the official docs are a bit "heavyweight", here's my minimalist setup for anyone who's interested. As a reminder, this is for Debian lenny with IceWM - YMMV:
  1. Run apt-get install scim-anthy (I've followed this HOWTO to stop apt-get automatically downloading recommended packages, so this only installs what's absolutely needed)
  2. Run scim -d from an xterm so it can create ~/.scim/global, then add a line to that file for your locale:
    /SupportedUnicodeLocales = en_NZ.UTF-8
    Apparently this isn't required if you use only en_US.UTF-8.
  3. Create ~/.xsessionrc with the following contents:
    # Set up environment for SCIM - daemon is launched from .icewm/startup
    export XMODIFIERS=@im=SCIM
    export GTK_IM_MODULE=xim
    Some docs say to edit .xsession but that won't work for IceWM.
  4. Create ~/.icewm/startup as follows to work around this bug:
    # Run SCIM in daemon mode - environment vars are set in .xsessionrc
    scim -d
    Unlike .xsessionrc this file has to be executable.
Then restart X and you're away. IceWM traps Ctrl-Alt-{Left,Right} for virtual desktop switching, but SCIM makes it easy to assign different keys if you need to switch between multiple IMs (which I don't).
And what rough beast, its hour come round at last,
Slouches towards Akihabara to be born?
Simon is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 04:32.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.
We use Silk.