A Japanese IME for Linux/X11 that works on a low level--- so it works anywhere!
Find a file
2024-09-06 16:46:07 -04:00
docs updated docs 2024-07-07 22:34:41 -04:00
src jinput refactor 2024-09-06 16:46:07 -04:00
.gitignore fixed memory leak 2024-07-12 15:36:51 -04:00
build.sh bug fixes 2023-12-20 06:05:52 -05:00
config.yaml updated docs 2024-07-07 22:34:41 -04:00
generate-docs.sh updated docs 2024-07-07 22:34:41 -04:00
README.md updated phrasing 2024-07-07 22:41:08 -04:00
schema.sql updated docs 2024-07-07 22:34:41 -04:00
sources.json fixed a bug, formatting, and point the dictonaries to my server 2024-07-06 16:37:11 -04:00
universalime.nimble jinput refactor 2024-09-06 16:46:07 -04:00

Introduction

Currently, in the Japanese space on Unix, you require third-party IME support to properly write kanji and kana. One of the more popular methods is toggling kanji conversion on and off from romaji, where you type "Konnnichiha" to produce "こんにちは".

These methods work efficiently, but they require specific integration for each window API. This limitation means that natively rendered programs or programs using APIs like SDL2 do not always work with IMEs. As a result, maintainers sometimes face challenges making them compatible. One workaround is interacting directly with X11 for kana and kanji support, which is what UniversalIME accomplishes.

UniversalIme

  • Works Anywhere*
  • GUI-Based Kanji Conversion
  • Non-GUI Kanji Conversion (works anywhere*)

How does it work?

Inspired by xdotool, UniversalIME exploits the mutability of the keyboard map in X11. By utilizing unused keycodes (referred to as "Scratch codes"), UniversalIME allows you to type kana in romaji and convert it into kanji.

UniversalIme requires root

UniversalIME reads the Linux kernel's input channel for your keyboard and mouse (see jinput.nim) at /dev/input. When kana reading is enabled, it processes it through a romaji converter. Once the kana converter produces an output (e.g., 'w + a' -> わ / ワ), it removes the input characters by sending a backspace to the Xserver.

This means that, in most cases, you can write kana and kanji anywhere you can type.

How do I type kanji?

By default, the process is as follows:

  1. Type the kana you want to convert, e.g., ろく (roku).

  2. Determine the number of kana you wish to convert. For 'roku', it's 2. If you only want to convert 'ku', you would choose '1'.

  3. Type the prefix keybind (by default, Ctrl+Shift) followed by the length of the kanji you want to search. For example, Ctrl+Shift+2.

  4. If GUI is enabled, a graphical interface will appear at your mouse cursor. Otherwise, you can scroll through kanji options using macros. By default: Shift+Shift for up, Ctrl+Ctrl for down.

Here's an illustration of the above

Too good to be true?

There are situations where programs might not support multi-byte characters or have code that prevents this method from working, such as 'Minecraft'. However, it works in other programs like Team Fortress 2, where many other IMEs fail. This could be considered a fundamental, potentially unfixable flaw.

Configuration

In /opt/universalime/config.yaml, you will find a configuration file where you can adjust various settings defined in config.nim. The default settings are defined in ./config.yaml and are statically linked into the compiled output.

Default Settings

  • GUI (uses the GUI for kanji conversion instead of non-graphical interactive version)
  • Start kanji conversion (left-shift + right-shift) (see readme)
  • Enable katakana (Ctrl+Space)
  • Convert to Kanji (Ctrl+Shift+Digit)

See config.yaml for the complete list of default settings. Modify them at /opt/universalime/config.ime.

Dependencies

  • GTK3

Install GTK3 as it cannot be statically linked.