I have a new 60% keyboard (NuPhy Air60), but it does not have any way to trigger pageup/pagedown or home/end keys.

My goal is to recover these commands with a custom keybinding, using a modifier key like hyper or alt, in combination with the arrow keys. For my preference, something like:

  • alt + arrowup = pageup
  • alt + arrowdown = pagedown
  • alt + arrowleft = home
  • alt + arrowright = end

I tried to use xmodmap to make the bindings -- but unfortunately due to a years-old known chromium bug, my bindings there did not work in Chrome or VSCode.

What else can be done?


1 Answer 1


Keybindings via sxhkd and xdotool

These programs can be used as an alternative to xmodmap to facilitate custom key binds, and in a way that circumvents the issue with chromium.

  • sxhkd is a program that can be configured to run commands in response to key combinations.
  • xdotool is a program that can emulate keyboard events, targeted at the currently-focused application.

To bind alt+arrowkeys to home/end/pageup/pagedown:

  1. Install sxhkd and xdotool
    • for arch linux: sudo pacman -S sxhkd xdotool
    • these packages are commonly available in other distro's package managers
  2. Configure sxhkd in ~/.config/sxhkd/sxhkdrc as follows:
    alt + Up
      xdotool keyup Up key --clearmodifiers Prior
    alt + Down
      xdotool keyup Down key --clearmodifiers Next
    alt + Left
      xdotool keyup Left key --clearmodifiers Home
    alt + Right
      xdotool keyup Right key --clearmodifiers End
    • note that Prior and Next are "keysym" names that correspond to pageup and pagedown.
  3. Run the sxhkd daemon: sxhkd
    • you probably want to run this at startup
    • instructions for that will vary based on your specific desktop environment or window manager.

Source: this particular blog post was very helpful Using Capslock + hjkl as arrow keys on Linux

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .