February 23, 2022

Reassign keys in Linux

Get the key code:

xev | grep keycode

Press the needed key, then copy needed keycode.

In my case I want to reassign key with code 94 to Left shift:

Test it: xmodmap -e "keycode 94 = Shift_L"

Save it:

xmodmap -pke >~/.Xmodmap
echo "xmodmap .Xmodmap" > ~/.xinitrc

Voila!