A cross-platform input method switcher — Rust crate + CLI.
im-switch lets you query, switch, and list input methods from the command line or from Rust code. It is designed for tools that need to programmatically control input methods — for example, Vim/Neovim plugins that switch to an ASCII layout when leaving insert mode.
- Cross-platform — Linux, Windows, and macOS with a single unified API
- Linux auto-detection — automatically detects fcitx5 or ibus at runtime
- Library + CLI — use as a Rust crate (
cargo add im-switch) or as a standalone CLI tool - Windows IME control — get/set keyboard layout (KLID) and toggle IME on/off
| Platform | Backend |
|---|---|
| Linux | fcitx5 (D-Bus), ibus (CLI) |
| Windows | Win32 API (keyboard layout + IME) |
| macOS | Carbon TIS API |
cargo install im-switch| Command | Description |
|---|---|
im-switch get |
Print the current input method |
im-switch set <id> |
Switch to the specified input method |
im-switch list |
List available input methods |
| Command | Description |
|---|---|
im-switch ime get |
Print IME state (enabled / disabled) |
im-switch ime enable |
Enable the IME |
im-switch ime disable |
Disable the IME |
im-switch ime toggle |
Toggle the IME state |
cargo add im-switchSee docs.rs for API documentation.
MIT