Skip to content

Instantly share code, notes, and snippets.

@CedricGatay
Created September 1, 2015 12:03
Show Gist options
  • Save CedricGatay/1673456ec94a1f6d8d0d to your computer and use it in GitHub Desktop.
Save CedricGatay/1673456ec94a1f6d8d0d to your computer and use it in GitHub Desktop.
Colemak via udev
ACTION=="add", ATTR{idVendor}=="1e54", ATTR{idProduct}=="2030", RUN+="/usr/local/bin/set_typematrix_colemak_mapping"
#!/bin/bash
IFS={
PROGRAM=$(cat <<'EOP'
sleep 5 # to ensure the keyboard is up, might be useless
DISPLAY=":0.0"
HOME=/home/cgatay/
XAUTHORITY=$HOME/.Xauthority
export DISPLAY XAUTHORITY HOME
export XAUTHORITY HOME
ID=`xinput list | grep TypeMatrix | grep keyboard | sed 's/.*id=\([0-9]*\).*/\1/'`
setxkbmap -device $ID us -variant colemak
# mapping insert on mail key
xmodmap -e 'keycode 163=Insert'
notify-send "Typematrix colemak mapping enabled"
EOP
)
echo -e $PROGRAM | at now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment