Longtime no post on my blog , and i just brought a nice USB keyboard from local store.
But it really sucks each time i plug in my USB keyboard. Since X11 is on the hood , my customized key mapping will fail to process unless i relaunch corresponding command set in ~/.xinitrc , namely `setxkbmap` in this case.
Digging a bit on Google , i found it possible to monitor USB device changes through well-defined dbus interfaces provided by Hal:
askubuntu.com/questions/27948/usb-device-changes-using-udev-and-d-bus
But since i adores perl , here i will demonstrate an equivalent and functional script written totally in perl , it’s available for downloading here:
Script preview can be found below , now i just unplugged my USB mouse and re-plugged it in , which instantaneously triggered huge outputs in my console:
Redistribution is allowed , and feel free to post a comment here , it’s welcomed ;-P

