3

When I try to change my keyboard layout in Ubuntu in a terminal with setxkbmap de, it does not change the layout in the terminal. Yet it changes the layout in other X applications.

I don't understand why this is. I assumed that the keyboard layout is used globally.

Is there a way to change the keyboard layout in the terminal as well?

1
  • 1
    Try to use the keyboard shortcut for switching layout instead of the setxkbmap command. The default shortcut is <Super>+<Space>. Feb 7, 2018 at 1:50

2 Answers 2

1

setxkbmap de does work, for example in Lubuntu.

But in standard Ubuntu it will be overwritten by a built-in application, that you can manage via the Settings menu.

Click on the icon with the cog wheel and wrench,

Settings menu - Text entry - button Keyboard settings - tab Typing - button Text entry

  • Add the input source German

and then you will be able to select language for the keyboard with the tray icon on the panel at the top of the screen from En to De

3
  • This is not very optimal because this would require to use the mouse. Also, I cannot to something like setxkbmap $LG -option caps:swapescape. And I still don't know why the effects are hidden in the terminal. Feb 6, 2018 at 19:06
  • We are not the developers. We only help with the existing Ubuntu and the Ubuntu community flavours (Kubuntu, Lubuntu ... Xubuntu). If you want the developers to modify Ubuntu, you should write a bug report at Launchpad. -- If this is an important issue for you, I suggest that you try Lubuntu.
    – sudodus
    Feb 6, 2018 at 19:11
  • Who is the culprit here? Gnome 3? Oct 24, 2023 at 10:46
1

The command you want is:

gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'de')]"

(and if anyone wants Dvorak, add +dvorak after the country code, e.g. us+dvorak or gb+dvorak or de+dvorak.)

1
  • Thanks! Do you know if there is a way to set custom keyboard layouts too, that I have created and put in /usr/share/X11/xkb/symbols?
    – lindhe
    Feb 22 at 20:49

You must log in to answer this question.

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