Ubuntu – Ubuntu Mate disable xkb and use iBus

18.04ibuskeyboard-layoutubuntu-mate

In my computer I need keyboard language support for:

  • English (US)
  • Greek
  • Japaneese

Hence the anthy (that I am used from 16.04LTS) is an option for me. Recently I ugraded from Ubuntu 16.04LTS into 18.04.2 LTS using the MATE variant.

Hence I installed iBus and anthy:

sudo apt-get install ibus ibus-anthy

And into language settings I have set the iBus Input option:
Selecting IBus as Input method

Also I have configured the iBus to ignore system settings as seen in this answer

And not due to double indicators in my system for input language I want to somehow "disable" the xkb/xinput/whatever powered one and use the iBus as universal language input for Greek, English and Japaneese(anthy) changing with
ALT+Shift keyboard stroke.

Furthermore in my desktop I have 2 indicators one for iBus and one for xmodmap:
language indicators

When I switch between 2 language inputs via Alt+Shift the non iBus one indicates the input language.

The xmodmap layout is configured like that:

$ setxkbmap -query

rules:      evdev
model:      pc105
layout:     gr,us
variant:    ,
options:    grp:alt_shift_toggle,grp_led:scroll,grp:alt_shift_toggle,grp_led:scroll

I tried temporary to disable xmodmap language input with:

setxkbmap -layout us

But it seems not only unable to change the language input but to get stick with english too. Also in this situation once I change the language input from iBUS indicator into greek I can use and change language inputs.

Also In this case one temporary "disabled" the xkbmap I get these settings:

rules:      evdev
model:      pc105
layout:     us
options:    grp:alt_shift_toggle,grp_led:scroll,grp:alt_shift_toggle,grp_led:scroll

Thus as far as I understood the xmodmap overrides the iBus and I want to make it stop to do that and let iBus handle any language input. So in order to do that I need to completely disable the options in setxkbmap so how I can do that?

Best Answer

Let's start with clean settings.

  1. Reset MATE keyboard settings

    dconf reset -f /org/mate/desktop/peripherals/keyboard/
    
  2. Reset global system keyboard settings, fill /etc/default/keyboard with the following contents:

    # KEYBOARD CONFIGURATION FILE
    
    # Consult the keyboard(5) manual page.
    
    XKBMODEL="pc105"
    XKBLAYOUT="us"
    XKBVARIANT=""
    XKBOPTIONS=""
    
    BACKSPACE="guess"
    

    and apply this settings into initramfs image with sudo update-initramfs -u -k all.

  3. Launch Language Support (or gnome-language-selector) and ensure that you have installed English, Greek and Japanese languages; also ensure that Keyboard input system is set to IBus.

  4. Launch IBus Preferences (or ibus-setup) and add languages here and set up layout switching shortcut for them, logout and login back (or reboot).

    Note: I have set Alt+Shift here, but it does not switch language. Alternative shortcut such as Super+Space switches the language.