0

I use 4 languages and I'm looking for a convenient way to switch the keyboard layout (input source). There's a key to switch to the next layout, but it's hard to use - it requires remembering what the current layout is to calculate how many times you have to press the switch button layout (up to 3 times).

I was thinking about buying an additional programmable keyboard but noticed that there're a lot of unused buttons on my current keyboard - I don't use numpad at all.

Is it possible to define custom hotkeys for setting the specific layout in ubuntu 20.04? It should be like:

  • 1 (on the numpad only) - set keyboard layout to EN,
  • 2 (on the numpad only) - set keyboard layout to RU,
  • 3 (on the numpad only) - set keyboard layout to LT,
  • 4 (on the numpad only) - set keyboard layout to PL
Kasheftin
  • 333
  • 2 3 4 are numpad and keys above qwerty both? or only keys above qwerty?? – PRATAP Jul 10 '20 at 15:01
  • have you tried to set any shortcut which those keys you mentioned?? if you can set the shortcuts with those keys it is possible to set what you are looking for.. – PRATAP Jul 10 '20 at 15:03
  • 1
    If you use the default + shortcut on Ubuntu, a thing shows up which lets you pick the desired input source directly. – Gunnar Hjalmarsson Jul 10 '20 at 15:03
  • 1, 2, 3, 4 - all the keys for setting the layout are on the numpad only. Numbers above keyboard used as regular numbers/regular letters accordingly to the layout. And that's not necessary the numbers, just any keys on the numpad will fit. – Kasheftin Jul 10 '20 at 17:37

1 Answers1

0

Found the solution here, How to configure shortcuts to switch to specific keyboard layout in ubuntu 14

Works like a charm.

setxkbmap us changes the keyboard layout to us. Then you have to assign 1 to this command using settings->keyboard shortcuts -> + Add new shortcut, 2 - setxkbmap ru, etc.

The only issue is that the language widget does not work properly with setxkbmap - it shows some value, that still can be changed using the default keys to switch the layout, but luckily it does not affect on the keyboard in any way after using setxkbmap. I was able to get rid of it using settings->region & language -> remove everything except an English input source.

Kasheftin
  • 333