Hi Santos
... Am I missing something?
Maybe. Or maybe I missed something. Or maybe we both missed something.
OK, I decided to test this out on one of my machines. I changed RUN+= to:
RUN+="/bin/ash -c 'touch /home/tc/KBD'"
Make udev aware of the new rules file:
sudo udevadm control --reload-rules
I unplugged and replugged the keyboard. When I checked my home directory, there was an empty file called KBD, so
the rule did run. I also noticed it remembered that NumLock was on.
I use a US keyboard so have no need for setxkbmap , but I have numlockx.tcz installed and used that for the
next test. I changed RUN+= to:
RUN+="/bin/ash -c 'DISPLAY=:0 /usr/local/bin/numlockx off'"
I unplugged and replugged the keyboard. The NumLock LED briefly lit up before numlockx turned NumLock off.
So running an X application to change the keyboard works too.
Remember to run the udevadm command when you first copy the file to /etc/udev/rules.d/
When editing the file, don't forget to hit Save before testing it again.
Watch your spelling, punctuation, and capitalization when making changes.
... (.txt file downloaded ...
On the off chance you changed it, I think the filenames have to end in
.rule