Last active
September 27, 2017 09:22
-
-
Save MichaelBitard/3531813 to your computer and use it in GitHub Desktop.
TypeMatrix auto set dvorak mapping when usb is plugged in
This file contains hidden or 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{idProduct}=="2030", RUN+="/usr/bin/set_typematrix_dvorak_mapping" |
This file contains hidden or 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 | |
{ | |
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' | |
} & |
Based on : https://gist.github.com/3227673
On ubuntu older than 12.04, replace ATTR{idProduct}, by SYSFS{idProduct}
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
lsusb : Bus 002 Device 053: ID 1e54:2030 TypeMatrix 2030 USB Keyboard