Default im-config configuration

im-config does two things:

  1. It launches an input method framework (e.g. IBus or Fcitx)

  2. It sets a few environment variables which are needed for the input method engines to work.

In standard Ubuntu, which uses GNOME and where IBus is integrated, im-config does not matter much by default. GNOME launches IBus and configures a couple of variables anyway. The presence of im-config is useful though for users who want to use some other IM framework but IBus.

In the Ubuntu flavors the im-config default configuration is of greater importance. For a few cycles now it has worked this way:

  • In MATE, Kylin and Unity im-config has been configured to launch and configure an IM framework by default, i.e. provided that such a thing has been installed, of course.

  • In the other flavors im-config has been configured to launch and configure an IM framework by default only in the case of a CJKV locale.

The reason for the latter is that users who don’t need an input method reported more or less subtle issues which were only present when e.g. IBus or Fcitx was running and configured.

However, this choice leads to confusion for some input method users. Take a Kubuntu user, for instance, who installs the system in English. Then they install some IBus input method, which also pulls IBus itself if not already installed. But “it still does not work”, and the reason is that - due to the current default configuration - they also need to explicitly select “ibus” via im-config.

The latest example I saw is this Ask Ubuntu question:

https://askubuntu.com/questions/1256521/ibus-does-not-start-automatically-on-kubuntu

My belief is that it would be better to change the default im-config configuration for other flavors but MATE, Kylin and Unity so it launches and configures an IM framework by default irrespective of the system locale.

To the extent the subtle issues I mentioned for non-IM users are still there, one way for a flavor to handle it is to not include any IM framework on the ISO. That’s not an option for Lubuntu, though, since it uses Fcitx for managing all input sources, i.e. also XKB keyboard layouts.

I would appreciate feedback on my suggestion from the leaders of the affected flavors.

Ping: @acheron, @tsimonq2, @fossfreedom, @eeickmeyer

(also pinged Sean Davis on IRC)

To the extent the subtle issues I mentioned for non-IM users are still there, one way for a flavoUr to handle it is to not include any IM framework on the ISO.

Not possible for Kubuntu at the moment, as the emoji picker in plasma requires all the /usr/share/ibus/dicts/ in ‘ibus-data’, and ibus-data ‘Recommends’ ibus, so that gets pulled in.

I was pondering setting ‘run_im none’ in the users .xinputrc, as in Groovy the ibus GTK tray icon starts, as starting that is not acceptable. This did not happen in Focal with the ibus/im-config in that release.

Ok, so ibus is installed by default in Kubuntu. Didn’t know that.

That’s odd. im-config ought to default to “none” in Kubuntu also in groovy (unless you have a CJKV locale). Can it be that KDE starts ibus-daemon by default in groovy just as GNOME does?

But your message is a bit sad… The Ask Ubuntu question I posted above was submitted by a Kubuntu user.

The change making it start by default came with the im-config changes that landed in Groovy. I tested that by reverting to the earlier packages, and the autostart went away. KDE/Plasma did not change in that regard.

Maybe setting ‘run_im cjkv’ makes more sense then.

That sounds worrying, and was certainly not intended. Will take a closer look.

@acheron: I figured out what the problem is. It’s my fault.

In im-config 0.44.1-1ubuntu1 I made some preparations aiming to eliminate the Ubuntu/Debian delta, i.e. in the hope that we will soon be able to use the very same source code in Ubuntu as in Debian. Specifically I edited /etc/default/im-config and changed this line:

if [ -n "$desktop" ]; then

to

if [ -n "$desktop" ] || ! dpkg-vendor --is ubuntu; then

However, the dpkg-vendor command is provided by the dpkg-dev package, which is not installed by default, so the code fails with the result that the default mode is always set to “auto”.

One way to fix it would be to add dpkg-dev to the runtime dependencies in im-config. However, that would pull a bunch of other packages with 29 MB archive space and 131 MB disk space…

@seb128, are you able to provide some advice here? Is there any smarter way to distinguish Ubuntu (with flavors) from other Debian based distros at runtime?

@Gunnar, the depends would be better idea, a rather standard way to do that is to use e.g

lsb_release -i -s` = “Ubuntu”

Thanks @seb128! Changing that line to:

if [ -n "$desktop" -o "$(lsb_release -is)" != 'Ubuntu' ]; then

seems to do it. Tried it successfully on Kubuntu groovy.

(I have already polluted the Debian repo with this bug, so I’d better start fixing it there…)

Just catching up. I am embarrassed to say that I looked at that line, but I did not remember that dpkg-dev would not be installed by default! Thanks for the analysis, and looking forward to a fix.

@acheron: The groovy issue has been fixed in im-config 0.44.1-1ubuntu3.

But now back to my original idea, i.e. making im-config launch and configure an IM framework by default.

How about changing the ibus Recommends in ibus-data to a Suggests? Your case shows that ibus-data may well be used without ibus (which Depends on ibus-data, btw.) AFAICT that would open for the suggested improvement for Kubuntu input method users.

Demoting to suggests would be ideal from my point of view. I HAVE been meaning to file a bug on this for a while, but what with one thing and another, have not quite got to doing it.

1 Like

https://bugs.debian.org/964558