Setxkbmap: Multiple layouts with different variants

keyboard-layoutx11xkb

Using setxkbmap from a user's .xinitrc, I'd like to configure:

  • German keyboard layout (de) without dead keys (variant nodeadkeys).

  • French keyboard layout (fr) with dead keys (variant basic).

So far I only managed to specify the same variant for both:

setxkbmap de,fr nodeadkeys

Is it possible to specify different variants?

Best Answer

As per xorg docs and archwiki:

You must specify as many variants as the number of specified layouts. If you want the default variant, specify an empty string as the variant (the comma must stay)

i.e.

setxkbmap -layout "L1,L2, ... ,Ln" -variant "V1,V2, ... ,Vn"

In your case:

setxkbmap -layout "de,fr" -variant "nodeadkeys,basic"
Related Question