2026-05-28 19:04:41 +09:00
2026-02-08 18:10:21 +09:00
2025-12-28 19:50:38 +09:00
2026-05-28 18:50:42 +09:00
2026-02-08 16:57:52 +09:00
2025-12-23 22:09:36 +09:00
2025-12-23 22:14:06 +09:00
2026-02-08 17:57:23 +09:00
2026-05-28 17:28:42 +09:00
2026-02-08 16:29:29 +09:00
2026-05-28 17:28:47 +09:00
2026-02-08 18:10:21 +09:00
2026-02-08 16:29:29 +09:00
2026-05-28 17:28:51 +09:00
2025-12-23 20:21:56 +09:00
2026-02-08 16:52:08 +09:00
2026-05-28 17:28:47 +09:00
2026-05-28 17:28:47 +09:00
2026-05-28 18:10:41 +09:00
2025-12-28 19:50:38 +09:00
2026-05-28 18:50:42 +09:00
2025-12-23 20:21:56 +09:00
2025-12-23 20:21:56 +09:00
2026-05-28 18:10:41 +09:00
2026-02-08 16:36:59 +09:00
2026-02-08 16:57:52 +09:00
2026-05-28 19:04:41 +09:00
2026-02-08 18:10:21 +09:00

strans

An input method daemon for CJK text entry on X11 and Wayland.

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

Dependencies

  • plan9port
  • dbus-1
  • wayland-client, libxkbcommon (for Wayland support)
  • 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

For Wayland apps (text-input-v3 clients on wlroots compositors):

# nothing to set; the compositor relays text-input-v3 to strans

Strans itself is the IBus endpoint and the Wayland input-method-v2 client; no ibus-daemon or fcitx5 needed. Start strans after the compositor.

Usage

Switch input modes with Ctrl + key:

N  Hiragana
K  Katakana
S  Hangul
T  English
V  Vietnamese (Telex)
E  Emoji
P  Toggle preedit/candidate popup window

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

Architecture

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)
wayland.c   wayland input-method-v2 adapter
map/        transliteration tables
font/       bundled CJK fonts

input-method-unstable-v2-*.{c,h}   wayland-scanner output, vendored
virtual-keyboard-unstable-v1-*.{c,h}

The two Wayland protocols (input-method-v2, virtual-keyboard-v1) are wlroots-only and not in the upstream wayland-protocols package, so the generated client code is vendored. Regenerate with wayland-scanner if the XML upstream ever changes (it hasn't in years).

References

Description
No description provided
Readme 38 MiB
Languages
C 98.9%
Python 0.7%
CMake 0.2%
Makefile 0.1%