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"
Related videos on Youtube
Author by
feklee
Updated on September 18, 2022Comments
-
feklee over 1 year
Using
setxkbmap
from a user's.xinitrc
, I'd like to configure:German keyboard layout (
de
) without dead keys (variantnodeadkeys
).French keyboard layout (
fr
) with dead keys (variantbasic
).
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 over 4 yearsIf 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 over 4 yearsYou might want to also set a key to switch between keyboard layouts, such as the two shifts:
setxkbmap -option grp:shifts_toggle
-
kohane15 over 2 yearsHere'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'