Possible Duplicate:
Separate keyboard for shortcuts on linux (two keyboards,two layouts)
I have a laptop with a US layout and an external keyboard with a Spanish layout. Is it possible to detect from which keyboard the last keypress came so I can change the layout accordingly? It could be a simple script using setxkbmap that runs after logging in.
edit: Separate keyboard for shortcuts on linux (two keyboards,two layouts) works perfectly.
setxkbmapapplies to all currently connected keyboards, and plugging in a new one (e.g. USB) on xorg.conf-less Xorg 7.6 gives me default US layout on the external one. – jørgensen Dec 16 '11 at 21:35