Is it possible to use terminal commands to switch between keyboard layouts in ibus? I can't see any GUI way to do it in XFCE.

  • @DKBose The default keyboard layout app in XFCE didn't have any option for the keyboard layout I need (phonetic Tamil.) That's why I installed ibus. I have Lubuntu, but I've installed xubuntu-desktop and mostly use that. The only way I've found now is to log out of XFCE, into Lubuntu to switch layout, then back into XFCE. – Revetahw says Reinstate Monica May 30 '16 at 16:57
  • 1
    I admit I do not know if it works in your case --- I have ibus installed but I am not sure I'm using it --- can you try setxkbmap -query when you have the correct layout, and setxkbmap -layout XX -variant YYYYYY -option A:B,C:D to switch? obviously substitute XX, YYY etc. with the output that -query gives to you. – Rmano May 30 '16 at 17:14
  • @Rmano setxkbmap -query tells me that the layout is gb, no matter if I have Tamil or US English active. – Revetahw says Reinstate Monica May 30 '16 at 18:01
  • @Rmano please post your comment as an answer, it actually answers the question posed, which is shown in google not the underlying personal problem of the asker. I needed this to define a custom shortcut for Ctrl+2 to set an often needed language instead of always having to choose in the switching menu shown in the switch-shortcut (super+space for me) – mxmlnkn Feb 12 '17 at 15:36
  • @mxmlnkn, done. – Rmano Feb 12 '17 at 17:40

Actually, ibus provides an system tray applet.

  1. Run ibus-setup
  2. On General tab, Check Show icon on system tray
  3. On General tab, confirm you have shortcut
  4. On Advanced tab,Uncheck Use system keyboard layout

ibus applet

| improve this answer | |

It's more related to xkb than to ibus (but I am not sure I completely understand the intricacy of the keyboard handling, as you can see in this post of mine) but you can detect the current configuration with

[romano:~] % setxkbmap -query
rules:      evdev
model:      pc105
layout:     es,gb
variant:    standard_tlde,
options:    caps:none,compose:caps,terminate:ctrl_alt_bksp

note it down, and then use

setxkbmap -layout es -variant standard_tlde -option caps:none,compose:caps,terminate:ctrl_alt_bksp

that you can associate to a key. It should work in all Ubuntu flavors, at least X11-based (no idea about wayland).

| improve this answer | |

Use ibus command to set m17n

ibus engine m17n:te:itrans

to set us

ibus engine xkb:us::eng

list engines

ibus list-engine

show available engines

ibus read-config
| improve this answer | |
  • Unfortunately it resets to the GUI-selected one as soon as you switch terminal (even if you switch back). – OJFord May 16 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.