setxkbmap: Multiple layouts with different variants

5,766

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"
Share:
5,766

Related videos on Youtube

feklee
Author by

feklee

Updated on September 18, 2022

Comments

  • feklee
    feklee over 1 year

    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?

  • Boris Verkhovskiy
    Boris Verkhovskiy over 4 years
    If one of your keyboards doesn't need a variant, put a comma and then leave the value blank -layout "L1,L2" -variant "V1,"
  • Boris Verkhovskiy
    Boris Verkhovskiy over 4 years
    You might want to also set a key to switch between keyboard layouts, such as the two shifts: setxkbmap -option grp:shifts_toggle
  • kohane15
    kohane15 over 2 years
    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'