3

I am running Debian 11 Bullseye for AMD64 on an HP Pavillion Touch 14-N009LA laptop, using IBus and MATE as desktop environment, having upgraded recently from Buster. Prior to upgrading point release, I could use the Latin American keyboard layout with IBus; afterwards, I am no longer able to do so.

The Keyboard Preferences app on MATE Control Center shows the Latin American Spanish layout, and I can manually set it with setxkbmap latam on a terminal (before IBus kicks in and replaces it), but on IBus I am only presented with the "Spanish" keyboard, which corresponds to the Spaniard Spanish keyboard that has different punctuation keys; there is no option for "Latin American" or anything similar.

Running ibus list-engine gives me the following output, in which I can't see the Latin American Spanish layout, and no matches for latam or anything similar:

<irrelevant languages omitted>
language: Spanish
  xkb:es:nodeadkeys:spa - Spanish (no dead keys)
  xkb:es:sundeadkeys:spa - Spanish (Sun dead keys)
  xkb:es:winkeys:spa - Spanish (Windows)
  xkb:es:dvorak:spa - Spanish (Dvorak)
  xkb:es:deadtilde:spa - Spanish (dead tilde)
  xkb:es:mac:spa - Spanish (Macintosh)
  xkb:es::spa - Spanish
<irrelevant languages omitted>

So far I could only find a guide that only seems to apply to Ubuntu, and the Arch Linux guide for IBus.

The former guide suggested that maybe I had to generate a Spanish locale for my system, which I did by uncommenting the es-MX locales from /etc/locale.gen and then running locale-gen. Afterwards, I rebooted my system. It didn't work.

Any other idea on how could I use the Latin American Spanish layout on IBus for Debian Bullseye?

2 Answers 2

6

UPDATE. I've found that the latest commit in the IBus source has the blacklist already implemented, and that all Latin American layouts are blacklisted by default.

This affects the generation process, which is done with a Python script on build time, which in turn, sources the available X layouts from /usr/share/X11/xkb/rules/evdev.xml, as this comment clearly states.

The exact commit on which this restriction was implemented is here. As for the reason why this was done, is honestly beyond me, and until this situation is properly addressed, the fix I propose below must be applied every time IBus is updated (as stated in this previous answer).


I've faced the same problem in Xubuntu 22.04, and recently used a workaround that involves editing a whitelist.

Even though it's been suggested that IBus 1.5.23 would include a blacklist, in place of the currently used whitelist, so that engines added would automatically appear as selectable layouts, it seems this feature is yet to be implemented (I have version 1.5.26 right now).

What I did to make it work is as follows:

  1. Open the file /usr/share/ibus/component/simple.xml using sudo, and your editor of choice.

  2. Locate the xkb:es::spa engine. In my machine, it looks like this:

<engine>
    <name>xkb:es::spa</name>
    <language>es</language>
    <license>GPL</license>
    <author>Peng Huang &lt;[email protected]&gt;</author>
    <layout>es</layout>
    <longname>Spanish</longname>
    <description>Spanish</description>
    <icon>ibus-keyboard</icon>
    <rank>50</rank>
</engine>
  1. Once found, copy the <engine> tag and paste it beside it (as a sibling, on the same level), and change the following tag values:

    • name, from xkb:es::spa to xkb:latam::spa.
    • layout, from es to latam.
    • longname, to any text of your choice so that you can distinguish it from other layouts.

It should now look like this:

<!-- I added this one. vvv -->
<engine>
    <name>xkb:latam::spa</name>
    <language>es</language>
    <license>GPL</license>
    <author>logo_writer</author>
    <layout>latam</layout>
    <longname>Spanish Latam</longname>
    <description>Spanish Latam</description>
    <icon>ibus-keyboard</icon>
    <rank>50</rank>
</engine>
<!-- I added this one. ^^^ -->

<engine>
    <name>xkb:es::spa</name>
    <language>es</language>
    <license>GPL</license>
    <author>Peng Huang &lt;[email protected]&gt;</author>
    <layout>es</layout>
    <longname>Spanish</longname>
    <description>Spanish</description>
    <icon>ibus-keyboard</icon>
    <rank>50</rank>
</engine>
  1. Once the new engine is added, save the file.

  2. Restart the IBus service, by issuing the command ibus restart.

  3. Once IBus restarts, type ibus list-engine and check that the new engine appears in the list.

In my machine, I have the following configurations. The one I added is Spanish Latam.

$ ibus list-engine | grep -A 7 Espa
idioma: Español
  xkb:es:nodeadkeys:spa - Spanish (no dead keys)
  xkb:es:winkeys:spa - Spanish (Windows)
  xkb:es:dvorak:spa - Spanish (Dvorak)
  xkb:es:deadtilde:spa - Spanish (dead tilde)
  xkb:latam::spa - Spanish Latam
  xkb:es:mac:spa - Spanish (Macintosh)
  xkb:es::spa - Spanish
  1. Using ibus-setup or ibus engine, set the layout to the one you previosuly created. At this point, it should work.

I hope this works for you. :)

2
  • 1
    It worked me perfectly (Arch Linux 2022 :3) Thank you so much! Jun 17, 2022 at 18:20
  • 1
    I'm a little late to the party, but just now I had to deal with this again. And indeed, it worked flawlessly. Thank you very much ^^
    – RAKK
    May 25 at 1:17
2

I just removed all the keyboards from the Ibus Preferences and then run the command: setxkbmap latam in the terminal.

1
  • I will upvote but not check this answer. It is more of a workaround than an actual solution. However, experience has shown me that you never know when an actual solution cannot be implemented and a hack must be done...
    – RAKK
    May 25 at 1:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .