Skip to content

Instantly share code, notes, and snippets.

@takluyver
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takluyver/1f6f809b6b3126d2d2c5 to your computer and use it in GitHub Desktop.
Save takluyver/1f6f809b6b3126d2d2c5 to your computer and use it in GitHub Desktop.
UK keyboard layout on US keyboard -add backslash

I set up US physical keyboards with a UK layout, because I can type without looking at the keys. But the key for backslash is missing. This is how I remap it to AltGr+Z.

Edit /usr/share/X11/xkb/symbols/gb. In the extd section, add this line:

    key <AB01>  { [  z,                  Z,       backslash,        bar ] };

Also, change dead_grave to grave near the top of this section to fix backticks. Save the file.

Delete the cached files in /var/lib/xkb:

sudo rm /var/lib/xkb/server-*.xkm

Toggle layouts and possibly run setxkbmap to get the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment