Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a problem. I often plug in an external German keyboard to my US laptop, which helps me work faster. I can do xinput list and get the list and then do setxkbmap -device to set layout as de, but the problem is, depending on what else I have plugged in, the device number is not constant in every session. So every time I plug the keyboard in, or reboot my system, I have to do it again. I suppose I could write a shell script to fetch the name of the keyboard, and since I do not have another keyboard of same name, it would work, but I do not know how to accomplish this. Also, this script should not be called only at startup, but whenever an USB plug-n-play device is plugged in. I would be obliged to get some help.

Thanks in advance!

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.