Created
September 1, 2015 12:03
-
-
Save CedricGatay/1673456ec94a1f6d8d0d to your computer and use it in GitHub Desktop.
Colemak via udev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ACTION=="add", ATTR{idVendor}=="1e54", ATTR{idProduct}=="2030", RUN+="/usr/local/bin/set_typematrix_colemak_mapping" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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