Advertisement
Guest User

Console: Change Caps Lock to Home

a guest
Dec 19th, 2018
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. Xmodmap does not work when Emacs is used in the console (accessed with
  2. Ctrl+Alt+[F1-F6]) rather than X11. It's still reasonably simple to
  3. change.
  4.  
  5. Enter the keymap directory (see bottom of `man loadkeys'), and make a
  6. copy of your preferred keyboard layout. I use the Dvorak keyboard
  7. layout on Void Linux, so my commands are:
  8.  
  9. $ cd /usr/share/kbd/keymap/i386/dvorak/
  10. # cp dvorak.map.gz xah-fly.map.gz
  11. # Emacs xah-fly.map.gz
  12.  
  13. N.B. Debian and derivatives users may need to install the console-data
  14. package:
  15.  
  16. # apt-get install console-data
  17. $ cd /usr/share/keymaps/i386/dvorak/
  18. # cp dvorak.kmap.gz xah-fly.kmap.gz
  19. # Emacs xah-fly.kmap.gz
  20.  
  21. The Caps_Lock key is usually bound to keycode 58, and Home to 102, but
  22. you should check these yourself using the `showkey' command.
  23.  
  24. Keymaps often already contain a Caps_Lock binding; just query-replace
  25. `Caps_Lock' with `Home'. The Home key generally needs an extra line to
  26. change it to Caps_Lock:
  27.  
  28. keycode 102 = Caps_Lock
  29. !N.B. End this file with a blank line.
  30.  
  31. Test out your new keymap with the `loadkeys' command:
  32.  
  33. # loadkeys xah-fly.map.gz
  34.  
  35. On most Linux distributions, load this keymap at boot by editing the
  36. relevant line in /etc/rc.conf to read:
  37.  
  38. KEYMAP=xah-fly
  39.  
  40. Debian-based distributions instead require you to add this line to
  41. /etc/default/keyboard:
  42.  
  43. KMAP=/usr/share/keymaps/i386/dvorak/xah-fly.kmap.gz
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement