fcitx-imlist is a small program to show or change input method list.
There is already similar program exists - fcitx-remote command.
It can support to switch input method by fcitx-remote -s INPUT_METHOD,
but It doesn't support to change the order of input method list.
That is why I wrote this experimental program.
Both Fcitx 4 and Fcitx 5 are supported, one backend per build.
Fcitx 5 is the default backend. It talks to the
org.fcitx.Fcitx.Controller1 D-Bus interface directly, so GLib and GIO
are the only build dependencies.
% ./autogen.sh
% ./configure
% make
Pass --enable-fcitx4 to build against Fcitx 4 instead. That backend
uses fcitx-gclient, so its development package is required.
% ./configure --enable-fcitx4
Fcitx 4 names its keyboard engines fcitx-keyboard-us while Fcitx 5
calls the same thing keyboard-us. Both spellings, and the bare us,
are accepted on either backend. The examples below use Fcitx 4 names.
Use -l option to list input methods which is enabled.
% fcitx-imlist -l
fcitx-keyboard-jp (キーボード - 日本語) [enabled]
mozc (Mozc) [enabled]
fcitx-keyboard-us (キーボード - 英語 (US)) [enabled]
Use -l and -v option at the same time to list all input methods.
% fcitx-imlist -l -v
fcitx-keyboard-jp (キーボード - 日本語) [enabled]
mozc (Mozc) [enabled]
fcitx-keyboard-us (キーボード - 英語 (US)) [enabled]
fcitx-keyboard-af (キーボード - アフガニスタン語) [disabled]
fcitx-keyboard-af-fa-olpc (キーボード - アフガニスタン語 - ペルシア語 (アフガニスタン、ダリー語 OLPC)) [disabled]
fcitx-keyboard-af-olpc-ps (キーボード - アフガニスタン語 - パシュト語 (アフガニスタン、OLPC)) [disabled]
...
Use -s option with input methods list to change the order.
% fcitx-imlist -s fcitx-keyboard-us,mozc
fcitx-keyboard-us (キーボード - 英語 (US)) [enabled]
mozc (Mozc) [enabled]
fcitx-keyboard-jp (キーボード - 日本語) [enabled]
Omit fcitx-keyboard- prefix if you want.
% fcitx-imlist -s us,mozc,jp
fcitx-keyboard-us (キーボード - 英語 (US)) [enabled]
mozc (Mozc) [enabled]
fcitx-keyboard-jp (キーボード - 日本語) [enabled]
Use -t option to toggle input method set.
The input method set is pre-configured.
Here is the example configuration.
% gsettings get org.xdump.fcitximlist fcitx-imlist-default
'jp,mozc'
% gsettings get org.xdump.fcitximlist fcitx-imlist-alternative
'us,mozc'
In toggle mode, fcitx-imlist command switches above configuration.
Use -e option to put an input method in use. It is appended to the
input methods already in use.
% fcitx-imlist -e mozc
fcitx-keyboard-jp (キーボード - 日本語) [enabled]
mozc (Mozc) [enabled]
Fcitx 5 keeps input methods in named groups, and the options above act
on the group in use. Add -g to act on the groups themselves instead.
List the groups:
% fcitx-imlist -l -g
Default [current]
Alternative
Switch to a group:
% fcitx-imlist -s Alternative -g
Alternative [current]
Toggle to the next group, wrapping around at the end:
% fcitx-imlist -t -g
Default [current]
On Fcitx 4 these fail with a message, since it has no groups.