Linux: xmodmap: Swap 1 ↔ 8, 2 ↔ 7

By Xah Lee. Date: .
! ~/.Xmodmap
! 2015-06-15
! change number layout, but not the shifted symbols

! swap keys 8 and 1
keycode  17 = 1 asterisk 1 asterisk
keycode  10 = 8 exclam 8 exclam

! swap keys 7 and 2
keycode  11 = 7 at 7 at
keycode  16 = 2 ampersand 2 ampersand

[see Keyboard: What's the Most Efficient Layout for Numbers?]

Linux xmodmap keybinding