6

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?

0

1 Answer 1

12

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"
3
  • 1
    If one of your keyboards doesn't need a variant, put a comma and then leave the value blank -layout "L1,L2" -variant "V1," Aug 31, 2019 at 22:31
  • 1
    You might want to also set a key to switch between keyboard layouts, such as the two shifts: setxkbmap -option grp:shifts_toggle Aug 31, 2019 at 22:32
  • Here's the code to switch between qwerty and colemak using the toggle Alt+Shift: setxkbmap -layout "us,us" -variant ",colemak_dh_iso" -option 'grp:alt_shift_toggle'
    – kohane15
    Nov 23, 2021 at 5:06

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.