Tiny Core Base > CorePlus
[Solved] TCP 12 x64 How can I set up setxkbmap automatically?
xor:
Isn't there a script that can read the id code of the keyboard and run the necessary command accordingly!?
Rich:
Hi xor
I'm not aware of any such script.
The op said:
His keyboard sometimes becomes unplugged and forgets its settings.
When he plugs it back in, he wants it to automatically be detected and reconfigured.
If it did exist, how would you make that script run automatically?
Santos:
Hello
--- Quote from: Rich on February 09, 2022, 11:48:36 PM ---...
OK, I think I cracked it. Run the following command:
--- Code: ---udevadm monitor --env
--- End code ---
...
--- End quote ---
Yes, you did. It worked this time.
Main advantage of this udev rule over the config file is there is no need to close Xorg. But is specific for each keyboard, sometimes I do change keyboards.
So, second question. Can this be more universal? Meaning: to work with any keyboard being plugged in. I just want to know whether is possible or not, with some kind of glob expanding or regex. I want to check on this myself.
Thank you.
Rich:
Hi Santos
I can think of a few possibilities:
You can have multiple lines in the .rules file each with a different ID_VENDOR_ID and ID_MODEL_ID
It will only execute the line that matches your keyboard.
Using udevadm monitor --env
Check the ID_MODEL and ID_SERIAL fields for your keyboards. If either field contains the word Keyboard for
all of your keyboards, you can use that field instead of ID_VENDOR_ID and ID_MODEL_ID like this:
--- Code: ---ENV{ID_MODEL}=="*?eyboar?*"
--- End code ---
The second ? is there to prevent the forum error, you can replace it with the letter d if you wish.
Santos:
Amazing, thank you Rich. You've answered all my questions.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version