I am looking for a way to change the fcitx input method using a terminal command. I know I can use the hotkeys, but for the purposes of an application I am writing, I need to use a command (something similar to ibus engine [name] for ibus). I've been looking through the fcitx documentation, but haven't found anything. Anyone know of a command? Thanks!
The appropriate command is fcitx-remote -s <imname>
, where <imname>
is of course the name fcitx
uses to refer to the input method. Sadly, these names are not documented either, but you can find them in your fcitx
configuration file (in my system, it's ~/.config/fcitx/profile
), where there's a list of all the enabled (also, all disabled) input methods.
In particular, the names for xkb layouts go something like fcitx-keyboard-XYZ
. For example fcitx-keyboard-us
for the US English QWERTY layout, or fcitx-keyboard-de-dvorak
for a German Dvorak layout. As another example, the Mozc Japanese IM is called simply mozc
.
The current input method (the equivalent of ibus engine
without parameters) can be obtained from the same file, in the line that says IMName=<imname>
. Be aware, however, that the scope of this variable depends on whether you share the state between windows or not, and on whether fcitx
is active (the result of running fcitx-remote
).
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments