Skip to content

Instantly share code, notes, and snippets.

@MichalKalita
Created March 28, 2022 09:39
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 MichalKalita/5521fec3fcb64ac72fd2d7a2b74d1a64 to your computer and use it in GitHub Desktop.
Save MichalKalita/5521fec3fcb64ac72fd2d7a2b74d1a64 to your computer and use it in GitHub Desktop.
How to change keys Page Up/Page Down with Home/End, Lenovo computer, Linux
  1. List available keys xmodmap -pk

  2. Find key numbers, for my computer it's:

112 Prior <-> 110 Home
117 Next  <-> 115 End
  1. Try to change keys
xmodmap -e "keycode 112 = Home"
xmodmap -e "keycode 110 = Prior"

xmodmap -e "keycode 117 = End"
xmodmap -e "keycode 115 = Next"
  1. For pernament change, write commands to file ~/.config/autostart/swap.desktop and make this file executable chmod +x ~/.config/autostart/swap.desktop

Sources:

[Desktop Entry]
Name=Swap Keys
Exec=xmodmap -e "keycode 112 = Home" && xmodmap -e "keycode 110 = Prior" && xmodmap -e "keycode 117 = End" && xmodmap -e "keycode 115 = Next"
Terminal=false
Type=Application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment