Skip to content

Instantly share code, notes, and snippets.

@alloy-d
Created July 20, 2011 21:55
Show Gist options
  • Save alloy-d/1096022 to your computer and use it in GitHub Desktop.
Save alloy-d/1096022 to your computer and use it in GitHub Desktop.
Script to toggle Colemak keyboard layout properly on ThinkPad and Cr-48.
#!/bin/sh
ACTION=${1-help}
HOST=`hostname | cut -d'.' -f 1`
case "$ACTION" in
on)
setxkbmap us -variant colemak
xset r rate 255
case "$HOST" in
nagato) # ThinkPad T61p
xset r 66
;;
velaciela) # Cr-48
xset r 66
xset r 133
xmodmap -e "keycode 133 = BackSpace"
xmodmap -e "clear Mod4"
;;
esac
;;
off)
setxkbmap us
;;
help)
echo "Usage: colemak.sh on|off"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment