View Single Post
Posts: 8 | Thanked: 0 times | Joined on Oct 2009
#238
Originally Posted by jakoleh View Post
Here is my simple python script to execute setxkbmap when keyboard connects. You can test it if it is any use for you. It is very quick and dirty version, but is working for me. Just change those values to correct ones.
Cheers mate, that's great! Could you let me know if I'm using your script the right/best way... I'm doing the following:

1) Boot device, connect keyboard.
2) Open X Terminal, run setxkbmap manually.
3) Slide open built-in keyboard, press key.
4) In X Terminal, run 'nohup python keys.py &' (keys.py is your script). Close terminal.
5) Thereafter, whenever keyboard dis/reconnects, press a key on the built-in keyboard and the map will be reset.

Do you normally have to run setxkbmap manually? Are you placing your script in with the system init scripts or running as user?

Many thanks again