Could not get fcitx to work, so I resorted to the default ibus Chinese input method

Tried to install the full suite of fcitx stuff to get Chinese pinyin, but figured out I could not switch over due to this error in imsettings-switch:

$ imsettings-switch
Current desktop isn't supported by IMSettings. Please follow instructions on your desktop to enable Input Method.

I am running Fedora 36 Silverblue, Gnome shell 42.4, and Wayland.

Output of imsettings-list shows this:

- 1: IBus[ibus.conf] (recommended)
  2: FCITX[fcitx.conf] 
  3: X compose table[xcompose.conf] 
  4: fcitx5[fcitx5.conf]

Then I suppose Gnome ships with ibus by default, and within the Keyboard settings section, just add intelligent pinyin and you will get Chinese input.

Does someone know why I can’t get fcitx to work?

I have it working in Japanese (haven’t tried Chinese) in Fedora 37–got it working in F36 and upgraded. I had to use fcitx5. I cover the steps I took at Inputting Japanese in Linux and some BSDs.

With Gnome, I had to make few setting changes which I got from the Archwiki. It’s mentioned on the page, but to disable ibus integration, I had to run

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/IMModule':<'fcitx'>}"
1 Like

Thank you very much! The gsettings command was the exact one I needed. Though I am not going to use fcitx anymore (ibus works good enough), I imagine it will allow me to use imsettings again.

Lately, I’ve come to the conclusion that in Gnome, and probably most desktop evironments, as opposed to window managers like openbox or dwm, it’s easiest to use ibus. I stopped using it, because, in openbox on FreeBSD, I wound up having to write a script to make it change between Japanese and English, but in Gnome, at least and on the default RedHat workstation install, it works without problems for me.

So, I’d agree with you, it’s probably most efficient, especially on the workstation installs, to use the default ibus.
I’m glad I was able to point you towards the solution, even if you wound up not needing it. Who knows, it might help someone in the future.

One things I am struggling though, is setting a short cut to switch between input methods. So far I can only go into the tray, click on the icon to change it.

There seems to be no way to switch it with a shortcut like Ctrl+space.

Is this something you can put into a bash script, and then add it to custom shortcuts?

You can re-use the same shortcuts for input switching this way as well.

Yes, I mention it in the FreeBSD-9x section. That was why I switched to fcitx.

I made a script. Anyway, quoting from my own page.

Here is what I did with openbox. Although instructions in the ibus pkg-message suggest adding a few more things to one’s .bashrc (or other shell rc file), I’ve only needed the following.
export XMODIFIERS=@im=ibus
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=ibus
export LC_CTYPE=en_US.UTF-8
Next, create a small shell script. I put it in $HOME/bin, the script can go anywhere in your shell’s $PATH. (If that doesn’t mean anything to you, don’t worry about it. Make a directory in your home directory, called bin, if it doesn’t already exist, and put the script in there.) In this case, I’m using mozc. If you prefer to use anthy, just substitute anthy for mozc-jp in the script.
#!/bin/sh
if [ ibus engine = ‘mozc-jp’ ]; then
ibus engine xkb:us::eng
else
ibus engine mozc-jp #or whatever IME you prefer; change it above too.
fi
Note that those are backticks around ibus engine, not single quotes.

Name it somehing like imswitch.sh, and make it executable.
chmod 755 ~/bin/imswitch.sh
Now, in ibus-setup, the default is super+space. As testing has indicated that regardless of what I’ve set for the hotkey to switch input, it gets ignored, you can leave it at that, the script is going to perform the function of switching input methods. Lastly, in openbox, I added a stanza to link ctl+space to the script. My $HOME/.config/openbox/rc.xml file contains


imswitch.sh

Now, using ctl+space will switch between English and Japanese.

I mention using it with openbox, I assume you could add a custom keyboard shortcut to call the little script with Gnome. I haven’t tested this in several years, but it’s how I had to get ibus working with Japanese input in FreeBSD before switching to fcitx.

The page was written for beginners, so please forgive anything that sounds condescending.

1 Like

Oh no, I thank you for taking your time to write it.
The thing is, I really don’t have time to set all of this up with super+space already works.
I will succumb to the default method.

Edit: found out about this: Use alternative keyboard layouts Which is what I want. Perhaps it is different from what you are describing? Otherwise this should be an easier way to change input switching shortcut.
But this is only a Gnome thing.