sudo apt install xclip xcape
Copy the following text:
keycode 66 = Mode_switch
keysym h = h H Left
keysym l = l L Right
keysym k = k K Up
keysym j = j J Down
Create file with contents:
touch ~/.xmodmap
xclip -o > ~/.xmodmap
Copy the following text:
xmodmap ~/.xmodmap
xcape -e 'Mode_switch=Escape'
Create file with contents:
touch ~/xmodmap.sh
xclip -o > ~/xmodmap.sh
Make file executable:
chmod +x ~/xmodmap.sh
Copy the following text:
[Desktop Entry]
Type=Application
Exec=sh -c "$HOME/xmodmap.sh"
Hidden=false
X-GNOME-Autostart-enabled=true
Name=xmodmap
Comment=xmodmap script
Create file with contents:
touch ~/.config/autostart/xmodmap.desktop
xclip -o > ~/.config/autostart/xmodmap.desktop