Forrest logo
back to the setxkbmap tool

setxkbmap:tldr:03d07

setxkbmap: Set multiple keyboard layouts, their variants and switching option.
$ setxkbmap -layout ${us,de} -variant ${,qwerty} -option ${'grp:alt_caps_toggle'}
try on your machine

The command setxkbmap is used to set the XKB (X Keyboard Extension) mapping. It allows you to specify various keyboard layouts, variants, and options.

The specific command you provided, setxkbmap -layout ${us,de} -variant ${,qwerty} -option ${'grp:alt_caps_toggle'}, sets the following parameters:

  • -layout ${us,de}: Specifies the keyboard layouts to be used. In this case, it sets two layouts: "us" for the United States and "de" for Germany. The ${us,de} is a parameter expansion that expands to either "us" or "de" based on the system configuration. If the expansion fails, it will default to "us".
  • -variant ${,qwerty}: Specifies the keyboard variants for each layout. The ${,qwerty} parameter expansion will expand to an empty value for the first layout (in this case, "us") and "qwerty" for the second layout ("de"). Here, it means no specific variant is selected for the first layout, and the "qwerty" variant is chosen for the second layout.
  • -option ${'grp:alt_caps_toggle'}: Specifies additional keyboard options. The ${'grp:alt_caps_toggle'} parameter expansion sets the "grp:alt_caps_toggle" option. This option enables switching between the keyboard layouts by pressing the "Alt" and "Caps Lock" keys simultaneously.

Overall, this setxkbmap command sets the keyboard layouts, variants, and options based on the system configuration.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the setxkbmap tool