Tiny Core Base > CorePlus

[Solved] TCP 12 x64 How can I set up setxkbmap automatically?

<< < (2/4) > >>

Rich:
Hi Santos

--- Quote from: Santos on February 07, 2022, 01:25:06 AM --- ... I will try to test it again with the corrections. To have an alternative way of doing it. ...
--- End quote ---
I look forward to hearing whether it works or not. Remember to disable the Xorg keyboard config file and restart
Xorg prior to trying it.

The thread has been marked as solved.

Santos:
Hello Rich.

Today I tried with the corrections you made (.txt file downloaded and checked out). But still, no change. Counted up to 3 (even tried up to ten) with keyboard unplugged,  Xorg  keyboard config file removed and  Xorg  restarted.

Am I missing something?

Rich:
Hi Santos

--- Quote from: Santos on February 09, 2022, 01:09:32 AM --- ... Am I missing something?
--- End quote ---
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:

--- Code: ---RUN+="/bin/ash -c 'touch /home/tc/KBD'"
--- End code ---
Make udev aware of the new rules file:

--- Code: ---sudo udevadm control --reload-rules
--- End code ---
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:

--- Code: ---RUN+="/bin/ash -c 'DISPLAY=:0 /usr/local/bin/numlockx off'"
--- End code ---
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.

--- Quote --- ... (.txt file downloaded ...
--- End quote ---
On the off chance you changed it, I think the filenames have to end in  .rule

Santos:
Hello Rich

Followed each step very carefully, triple checked the punctuation, spelling, capitalization and saved all changes on file before closing it. And ran command to update rules.


--- Quote from: Rich on February 09, 2022, 10:15:25 AM ---... On the off chance you changed it, I think the filenames have to end in  .rule

--- End quote ---

Fear not. I downloaded the .txt file just to look at the content. I didn't blindly downloaded and put it in the directory. :-)

I did tested the same way you have done it. With a test file generated by  touch  . So I'm confident it is running the desired command, but maybe it is a quirk of  setxkbmap?

You can try by just changing your kbmap to something else and try to put it back on: en. With the udev rule.

Rich:
Hi Santos
OK, I think I cracked it. Run the following command:

--- Code: ---udevadm monitor --env
--- End code ---
Then unplug and replug the keyboard. You'll see  udev  print a bunch of messages. The last group is the  bind  command
for the keyboard. You want the values for  SUBSYSTEM, ID_VENDOR_ID, and ID_MODEL_ID  listed there.

Place the following in your  .rules  file with the values you found for  SUBSYSTEM, ID_VENDOR_ID, and ID_MODEL_ID.

--- Code: ---ACTION=="bind", SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="413c", ENV{ID_MODEL_ID}=="2005" RUN+="/bin/ash -c 'DISPLAY=:0 /usr/local/bin/setxkbmap es'"
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version