Skip to content

About

Command line tool to change the order of input method list for Fcitx

Resources

Stars

7 stars

Watchers

2 watching

Forks

Latest commit

 

History

93 Commits

Folders and files

Repository files navigation

fcitx-imlist

CI

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.

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

Usage

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.

How to show input methods?

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]

How to show all input methods?

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]
...

How to change the order of input methods?

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]

How to toggle input method set?

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.

How to enable an input method?

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]

Input method groups (Fcitx 5 only)

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.

About

Command line tool to change the order of input method list for Fcitx

Resources

Stars

7 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages