Accented characters using a US keyboard layout on OpenBSD

My refurbished ThinkPad T460s shipped with an International US layout keyboard. And with the default Xenocara configuration, I couldn’t type accents. As I write 90% of my real-life emails in French, this was an issue.

Well… until I read the OpenBSD manpages for setxkbmap(1) and xkeyboard-config(7). Then I added the following line to my ~/.xsession file:

setxkbmap -model pc105 -layout us -variant altgr-intl -option compose:rctrl

And I can now use the right Ctrl key as Compose and issue accented characters using the so called “dead-keys”.

Ctrl ' [aAeiou]  = áÁéíóú
Ctrl ` [aAeiou]  = àÀèìòù
Ctrl " [aAeiou]  = äÄëïöü
Ctrl ^ [aAeiou]  = âÂêîôû
Ctrl - [aAeiou]  = āĀēīōū
Ctrl ~ [aAeioun] = ãÃẽĩõũñ
Ctrl , [cC]      = çÇ

Note that Alt Gr can also be used by default. But the key positions are quite complicated to remember.

Author: Joel Carnat

@work Technical Architect and SysAdmin ; @home OpenBSD and FOSS, Karate, Kobudō, Jōdō, Bodyweight workout, Photography & Music

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.