mercredi 28 février 2024

Mapping keyboard in Ubuntu

mgirond@emys:/etc$ localectl list-keymaps
Failed to read list of keymaps: No such file or directory
mgirond@emys:/etc$ localectl
   System Locale: LANG=fr_FR.UTF-8
       VC Keymap: n/a
      X11 Layout: us
       X11 Model: pc105
wget https://mirrors.edge.kernel.org/pub/linux/utils/kbd/kbd-2.6.4.tar.gz -O /tmp/kbd-2.6.4.tar.gz
cd /tmp/ && tar xzf kbd-2.6.4.tar.gz
sudo mkdir /usr/share/keymaps/
sudo cp -Rp /tmp/kbd-2.6.4/data/keymaps/* /usr/share/keymaps/
localectl list-keymaps | grep -i fr
localectl set-keymap mac-fr-legacy
mgirond@emys:/tmp$ localectl status
   System Locale: LANG=fr_FR.UTF-8
       VC Keymap: mac-fr-legacy
      X11 Layout: us
       X11 Model: pc105

Other solution: List of available keyboard is
cat /usr/share/X11/xkb/rules/base.lst

cd /etc/default/
sudo nano keyboard
and change 
XKBLAYOUT="us"
to (or something else !)

XKBLAYOUT="fr"

Note that the mapping is not perfect with Mac keyboard; you can use option + ascii number to get the missing characters


To take into account the change
setupcon -k


Aucun commentaire: