Sunday, 27 November 2016

Change Thinkpad T61 page forward/back to page up/down in Linux

The Thinkpad T61 is a formidable machine that has earned it's place in history and for me is still my go-to laptop of choice despite its' 10+ year manufacture date.

There one flaw that I have found, that the Page Up/Page Down keys are in the most awkward of places, on the very top right of the keypad.

There are two keys in prime position that are not utilized at all on Linux, so here is a quick and dirty way to remap the Page Previous/Page Next to Page Up/Page Down.

This is an easy problem to fix through the use of xmodmap in your .bashrc file.

To remap the keys all you need to do is:
  • Open your bashrc with vim/emacs/nano ~.bashrc
  • Add these two lines to the bottom of the file
  xmodmap -e 'keycode 167=Next'
  xmodmap -e 'keycode 166=Prior'
  • Either log out or source your bashrc with source ~.bashrc
Then you should have a new Page Up/Page Down in the correct placement that is the most productive spot for such keys.