this post was submitted on 19 Jul 2023
6 points (100.0% liked)

OpenBSD

539 readers
1 users here now

General OpenBSD community!

founded 1 year ago
MODERATORS
 

I would like to add a new keyboard layout (FR - AZERTY AFNOR). What is the correct way to do it ?

Ideally I would like to use it for everything:

  • full disk encryption
  • TTY
  • xenodm
  • xenocara session

For now, I updated /usr/X11R6/share/X11/xkb/symbols/fr to add the variant, which I load in xenodm and my xsession using setxkbmap.

However I feel like it's not "clean" as it should be done with wsconsctl .

So what is the correct way to do it ?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 1 year ago (1 children)

I eventually managed to do it with /etc/wsconsctl.conf. You can load a base layout ("fr" in my case), and remap keys as you want using their symbols. Here is an exerpt from what I've done:

keyboard.encoding=fr
keyboard.map+="keycode 1 = at numbersign dead_breve dead_invertedbreve"
keyboard.map+="keycode 2 = agrave 1 section Agrave"
keyboard.map+="keycode 3 = eacute 2 dead_acute Eacute"
keyboard.map+="keycode 4 = egrave 3 dead_grave Egrave"
[…]

The hardest part is to figure which keycode correspond to which key on the keyboard, but it's not too hard if you dump the base layout with wsconsctl keyboard.map before-hand.

[–] [email protected] 2 points 1 year ago

Nice - thanks for sharing