Files
strans/README.md
2026-05-28 15:17:31 +09:00

1.7 KiB

strans

An input method daemon for CJK text entry on X11.

Inspired by 9front's ktrans. Threads communicate via CSP channels.

Dependencies

  • plan9port
  • dbus-1
  • gtk+-3.0 (optional, for GTK IM module)

Build

make
cd xim && make                          # XIM adapter
cd gtk && make docker && make install   # GTK IM module

Run

./strans map font &

For XIM apps:

./xim/strans-xim &
XMODIFIERS=@im=strans xterm

For GTK apps:

GTK_IM_MODULE=strans gedit

For IBus apps (kitty, foot, etc.):

GLFW_IM_MODULE=ibus kitty

Strans itself is the IBus endpoint; no ibus-daemon or fcitx5 needed.

Usage

Switch input modes with Ctrl + key:

N  Hiragana
K  Katakana
S  Hangul
T  English
V  Vietnamese (Telex)
E  Emoji

Type romanized input. Select candidates with 1-9 or arrow keys. Tab or Enter to commit.

Architecture

Four threads communicate via CSP channels:

Adapters (strans-xim, im-strans.so) bridge X11/GTK events.

Files

strans.c    input method engine
dict.c      dictionary queries
win.c       xcb window management
font.c      truetype rendering (stb_truetype)
map/        transliteration tables
font/       bundled CJK fonts

References