keyd
For linux key remapping, I use keyd On Arch Linux, this is available as a keyd AUR.
For my configuration I have a /etc/keyd/default.conf that gives me an overloaded ESC and CTRL on my Caps Lock key for all attached keyboards:
[ids]
*
[main]
# Maps capslock to escape when pressed and control when held.
capslock = overload(control, esc)
And then I have a keyboard specific config /etc/keyd/akko-3068bt.conf for my AKKO 3068BT for swapping the ESC and tilde/grave key:
[ids]
0c45:7638
[main]
capslock = overload(control, esc)
esc = `
` = esc
Other Tools
I’ve used Interception Tools before, which works similarly to keyd, but is harder to configure (but more powerful, see s2arrows or interception-vimpoved for example).
Input Remapper is a GUI based tool that looks like it supports a lot of features.
If you use Mac and Linux/Windows computers, there’s a tool called Kinto.sh that will transpose Mac-style shortcut keys to those platforms (the reverse isn’t really possible since Macs use both Option/Alt and Control chords…).
On Mac Karabiner (Elements) is the old-standby keyboard remapper but there’s also a new tool, KMonad that supports many remapping features on Win/Linux/Mac. People have also combined keyboard remapping with Hammerspoon a macOS automation framework.
- Consistent Keyboard Shortcuts Across macOS and Linux
- Efficient key bindings using both Mac and Linux
- rbreaves/macOS keyboard layout for Linux
- Those of you who switch between macOS and Linux or Windows - what do you do about typical keyboard shortcuts?
There’s also an article Key Remapping in Linux — 2021 Edition that also links to a Linux Key Remapping Software spreadsheet that lists a lot of different options.