Skip to content

Instantly share code, notes, and snippets.

@MichaelBitard
Last active September 27, 2017 09:22
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save MichaelBitard/3531813 to your computer and use it in GitHub Desktop.
Save MichaelBitard/3531813 to your computer and use it in GitHub Desktop.
TypeMatrix auto set dvorak mapping when usb is plugged in
ACTION=="add", ATTR{idProduct}=="2030", RUN+="/usr/bin/set_typematrix_dvorak_mapping"
#!/bin/bash
{
sleep 1
DISPLAY=":0.0"
HOME=/home/mbitard/
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 dvorak-alt-intl
# mapping insert on mail key
xmodmap -e 'keycode 163=Insert'
} &
@MichaelBitard
Copy link
Author

lsusb : Bus 002 Device 053: ID 1e54:2030 TypeMatrix 2030 USB Keyboard

@MichaelBitard
Copy link
Author

@MichaelBitard
Copy link
Author

On ubuntu older than 12.04, replace ATTR{idProduct}, by SYSFS{idProduct}

@MichaelBitard
Copy link
Author

put 85-typematrix.rules in /lib/udev/rules.d

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