Skip to content

Instantly share code, notes, and snippets.

@typester
Created October 14, 2019 18:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typester/7b688cdbc72d1e42d23241316e85dde3 to your computer and use it in GitHub Desktop.
Save typester/7b688cdbc72d1e42d23241316e85dde3 to your computer and use it in GitHub Desktop.
my hhkb settings
#!/bin/sh
set -e
# reset
pkill xcape | echo -n
setxkbmap -layout us
# SandS
xmodmap -e 'keycode 255=space'
xmodmap -e 'keycode 65=Shift_L'
xcape -e '#65=space'
# set HHKB keys to super
xmodmap -e 'keycode 102 = Super_L'
xmodmap -e 'keycode 100 = Super_R'
# # Right alt to mod4
xmodmap -e 'clear mod1'
xmodmap -e 'keycode 108 = Super_L'
xmodmap -e 'add mod1 = Alt_L'
xmodmap -e 'add mod1 = Meta_L'
# swap \ and BS
xmodmap -e 'keycode 22 = backslash bar'
xmodmap -e 'keycode 51 = BackSpace'
# swap Esc and `
xmodmap -e 'keycode 9 = grave asciitilde'
xmodmap -e 'keycode 49 = Escape'
# set keyrate
xset r rate 200 100
@jingpengw
Copy link

thanks a lot for this script!
it made my keyboard works well in CentOS.
I have to comment out the xcap line though since my workstation do not have this command.

@typester
Copy link
Author

Your welcome 👍

However, if you do not use xcape command, you should also comment out a couple of lines above the xcape line.
Otherwise, the space key will not work properly.

@jingpengw
Copy link

it seems that I only need these two lines:

xmodmap -e 'keycode 102 = Super_L'
xmodmap -e 'keycode 100 = Super_R'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment