ibus does not install itself as an option for the all_ALL quasi-locale

Bug #522814 reported by Zorael on 2010-02-16
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
im-config (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: ibus

Upon installation, ibus installs itself as a choice for several locales (xinput-lang_LANG alternatives), including ja_JP and ko_KR. This allows for use of the im-switch tool to change what input method to use for that locale.

It does not install itself as an option for the all_ALL quasi-locale, or more specifically, the xinput-all_ALL alternative. This makes it impossible to use im-switch to set my system-wide default to ibus. I run Kubuntu 10.04 with an English language setting and a Swedish locale. This behavior is present in Karmic as well.

    $ sudo im-switch -c
    No system wide default defined just for locale en_US .
    Use "all_ALL" quasi-locale and set IM.
    System wide default for all_ALL locale is marked with [+].
    There are 7 choices for the alternative xinput-all_ALL (providing /etc/X11/xinit/xinput.d/all_ALL).

      Selection Path Priority Status
    ------------------------------------------------------------
    * 0 /etc/X11/xinit/xinput.d/default 10 auto mode
      1 /etc/X11/xinit/xinput.d/default 10 manual mode
      2 /etc/X11/xinit/xinput.d/default-xim 0 manual mode
      3 /etc/X11/xinit/xinput.d/none 0 manual mode
      4 /etc/X11/xinit/xinput.d/uim 0 manual mode
      5 /etc/X11/xinit/xinput.d/uim-systray 0 manual mode
      6 /etc/X11/xinit/xinput.d/uim-toolbar 0 manual mode
      7 /etc/X11/xinit/xinput.d/uim-toolbar-qt 0 manual mode

    Press enter to keep the current choice[*], or type selection number:

As workarounds go, it is possible to modify the alternative configuration file (/var/lib/dpkg/alternatives/xinput-all_ALL) to include ibus, or to manually repoint the symlink at /etc/alternatives/xinput-all_ALL. I can also overwrite /etc/X11/xinit/xinput.d/default with the contents of the ibus file in the same directory.

Looking at the source, all_ALL is commented out at debian/ibus.postinst:12. Excerpt;

    case "$1" in
        configure)
            #ua_inst all_ALL ibus 0
            ua_inst ja_JP ibus 60
            ua_inst ko_KR ibus 60
    [...]

Unsure of the rationale of why it would be disabled that way. Both UIM and SCIM install themselves as choices to all_ALL, so installation of those methods is very easy.

ProblemType: Bug
Architecture: i386
Date: Tue Feb 16 20:28:01 2010
DistroRelease: Ubuntu 10.04
InstallationMedia: Kubuntu 10.04 "Lucid Lynx" - Alpha i386 (20100201)
Package: ibus 1.2.0.20091215-1ubuntu1
ProcEnviron:
 LANGUAGE=
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-12.17-generic
SourcePackage: ibus
Uname: Linux 2.6.32-12-generic i686

Zorael (zorael) wrote :

Zorael wrote:
> Public bug reported:
>
> Binary package hint: ibus
>
> Upon installation, ibus installs itself as a choice for several locales
> (xinput-lang_LANG alternatives), including ja_JP and ko_KR. This allows
> for use of the im-switch tool to change what input method to use for
> that locale.
>
> It does not install itself as an option for the all_ALL quasi-locale, or
> more specifically, the xinput-all_ALL alternative. This makes it
> impossible to use im-switch to set my system-wide default to ibus. I run
> Kubuntu 10.04 with an English language setting and a Swedish locale.
> This behavior is present in Karmic as well.

I'm sorry, but I cannot reproduce your problem. I can activate ibus
using im-switch for any locale just fine on Lucid, although I run Gnome
and not KDE.

Can any other KDE user reproduce this problem?

Do you have a clean installation from the Lucid CD or did you upgrade
from an older version?

Which steps did you do to set your language settings?

Zorael (zorael) wrote :

These have been clean Karmic and Lucid installations. I set my locale and language settings in the Ubiquity installer, and later in System Settings -> Regional and Language if the locale didn't stick.

From the output of locale;
    $ locale
    LANG=en_US.UTF-8
    LANGUAGE=
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=

From the output of 'im-switch -l';

    $ sudo im-switch -l
    Your input method setup under en_US locale as below.
    =======================================================
    No private configuration can be defined for root account.
    =======================================================
    The system wide default is pointed by "/etc/alternatives/xinput-all_ALL" .
    xinput-all_ALL - auto mode
     link currently points to default
    default - priority 10
    default-xim - priority 0
    none - priority 0
    uim - priority 0
    uim-systray - priority 0
    uim-toolbar - priority 0
    uim-toolbar-qt - priority 0
    Current `best' version is default.
    =======================================================
    The available input method configuration files are:
    default default-xim ibus ibus-kde lo-gtk none th-gtk th-xim uim uim-systray uim-toolbar uim-toolbar-qt
    =======================================================

Note how my system-wide default is pointed by the xinput-all_ALL alternative, which ibus' source is set up to reject.

pvautrin (pvautrin) wrote :

I have both ubuntu and kubuntu x64 fresh installs with locale set to en_AU, trying to type chinese pinyin (zh_CN).
I confirm it is not possible to use im-switch to set system-wide default to ibus.

This is not an issue in Ubuntu (I can still type chinese in every application), but I found this bug after encountering a problem in Kubuntu where I can type chinese in Konsole and Kate, but not in OpenOffice and Firefox (I get no input window). Let me know if I need to test other applications.
And when I try using "System Settings > Country/Region & Language > Locale > Select System Language > Keyboard input method", setting input method to ibus never gets stored (always reverts back to none).

Zorael, do you have a similar behavior?

I should clarify that in both ubuntu and kubuntu, "sudo im-switch -l" lists all input methods including ibus, but "sudo im-switch -c" does not give the option to select ibus.

Kubuntu:
ibus installed from kpackagekit.
/etc/alternatives/xinput-all_ALL -> /etc/X11/xinit/xinput.d/none (XIM=)
/etc/alternatives/xinput-zh_CN -> /etc/X11/xinit/xinput.d/ibus (XIM=ibus)
/home/pyv/.xinput.d/en_AU -> /etc/X11/xinit/xinput.d/ibus
$GTK_IM_MODULE and $QT_IM_MODULE both empty
/usr/lib/gtk-2.0/2.10.0/immodules/im-ibus.so does not exist <- Is that normal?
/usr/lib/qt4/plugins/inputmethods/libqtim-ibus.so exists

Ubuntu:
ibus installed from "System > Administration > Language Support > Keyboard input method system" (I think)
/etc/alternatives/xinput-all_ALL -> /etc/X11/xinit/xinput.d/default (XIM=)
/etc/alternatives/xinput-zh_CN -> /etc/X11/xinit/xinput.d/ibus (XIM=ibus)
/home/pyv/.xinput.d/en_AU -> /etc/X11/xinit/xinput.d/ibus
$GTK_IM_MODULE and $QT_IM_MODULE both set to ibus
/usr/lib/gtk-2.0/2.10.0/immodules/im-ibus.so exists
/usr/lib/qt4/plugins/inputmethods/libqtim-ibus.so does not exists

Finally, not sure if it's related but there is a typo in /etc/X11/xinit/xinput.d/ibus-kde on plasam-widget-kimpanel-backend-ibus (instead of plasma-...), also mentioned in bug 575730.

Hope this helps,
PY

Zorael (zorael) wrote :
Download full text (3.2 KiB)

If ibus works in some programs and not in others, that sounds as if your environmental variables are either wrong or the libraries they refer to are missing. I see there's logic in the ibus file to only set the variables if the actual libraries are installed. Otherwise, $GTK_IM_MODULE and $QT_IM_MODULE (and perhaps $XMODIFIERS) being empty suggests that your im-switch choice is pointing to the wrong file, likely 'default' or 'none'. And setting it aright is what's difficult.

So from the top, you first need the ibus-gtk and ibus-qt4 libraries installed. Then you need the proper environmental variables set, as gained by pointing the xinput-lang_LANG alternative for your locale to the /etc/X11/xinit/xinput.d/ibus file. This bug obstructs that by not making ibus available to the all_ALL locale, which seems to get used even though you use an en_AU locale (and I an en_US). I'm not sure why xinput doesn't simply interpret ours as en_US. Said file must also be properly configured - as it is notably not in Skim bug #403004.

1) I've only recently found out about the kalternatives program, available from lucid universe. With it you can graphically add /etc/X11/xinit/xinput.d/ibus to the xinput-all_ALL alternative, and then use im-switch to change to it. I'm unsure of whether this will persist through an ibus package update. It will install itself into System Settings -> Advanced tab -> System section, and obviously if you want to make system-wide changes you'll have to open System Settings with kdesudo. Alternatively from a terminal, 'kdesudo kcmshell4 kalternatives'.

2) You can also add the choice to the xinput-all_ALL alternative from a terminal by using the 'update-alternatives --install' command. When I toiled with it I strugged with its syntax and gave up, so kalternatives might be an easier approach.

3) While an even grittier solution, you can also add the choice manually by adding the entry to the /var/lib/dpkg/alternatives/xinput-all_ALL file, where the alternative's choices are listed. Entries consist of two lines; the first pointing to the file in /etc/X11/xinit/xinput.d/, the second it's numerical priority. I'm positive this gets overwritten at package updates though, at which point you'll have to redo your changes and set your xinput.d choice once more. So you'd need to add the following lines to said file;

    /etc/X11/xinit/xinput.d/ibus
    99

4) You can also probably overwrite one of the other files in /etc/X11/xinit/xinput.d/ with the content of the ibus file. They are installed as part of the im-switch package and don't see a lot of updates, so if manual changes keep getting overwritten I guess this is a workaround worth considering. Then you could just set your xinput alternative to 'none' or 'default' or whichever you cloned the ibus file to.

I'm currently using UIM, which does set itself up as a choice for xinput-all_ALL. And even in Lucid my machine becomes all_ALL, after having set it up to use a Swedish locale and an English translation in Ubiquity, at time of installation. I'm not sure if that's the real bug, but this would be very easy to fix in ibus by merely removing that commenting hashmark, as detailed in the origin...

Read more...

pvautrin (pvautrin) wrote :

I initially enabled ibus in all applications by pointing /etc/alternatives/xinput-all_ALL to /etc/X11/xinit/xinput.d/ibus, but after reading your 2nd paragraph, I realized that ibus-gtk needs to be manually installed.
So I reverted /etc/alternatives/xinput-all_ALL back to /etc/X11/xinit/xinput.d/none, installed ibus-gtk from kpackagekit and that did the trick.
So although I still can't change the all_ALL quasi locale, it's not an issue for me since I can still get the right behavior. In my case the link pointing to ibus for my locale is ~/.xinput.d/en_AU. I didn't try the other methods you described.
Thanks,
PY

I can confirm the reported behaviour for ibus on a fresh CD install of Kubuntu Lucid Lynx 10.04 on an AMD 64 system.

One consequent problem is that if I launch the KDE kate text editor version 3.4.5 for KDE 4.4.5 from the launchpad pparepos, I still get a "No Input Window" message from the ibus system tray icon. So, input method switching is not available in kate launched from an icon.

However, if I lauch kate from a KDE konsole terminal by typing

kate &

then I am able to access in kate the different languages I need through ibus.

FWIW, I think this is because my personal ~/.bashrc has the lines

export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus

but the non-availability of the system-wide alternatives as noted above make the ibus language options unavailable to kate launched from an icon.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ibus (Ubuntu):
status: New → Confirmed
Aron Xu (happyaron) wrote :

These stuff are handled in im-config nowadays.

affects: ibus (Ubuntu) → im-config (Ubuntu)
Changed in im-config (Ubuntu):
status: Confirmed → New
Gunnar Hjalmarsson (gunnarhj) wrote :

On 2014-07-27 14:31, Aron Xu wrote:
> These stuff are handled in im-config nowadays.

Yes, and in an im-config context the problem described in this bug report is not applicable.

Changed in im-config (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers