Tiny Core Base > CorePlus
[Solved] TCP 12 x64 How can I set up setxkbmap automatically?
Santos:
Hello
In fact is microcore build up with so many extensions that is not microcore anymore. Anyways, I'm aware of:
--- Code: ---/home/tc/home/.X.d/
--- End code ---
Which works when Xorg is properly closed and reopened. However, what I'm trying to get is a "persistent" setxkbmap configuration. When keyboard is unplugged, automatically setxkbmap reverts itself back to defaults (en). So I have to open a new terminal and type in:
--- Code: ---setxkbmap es
--- End code ---
Every single time I disconnect the keyboard, which happens quite often.
Is it possible to change the default keyboard layout so it always be: es?
Thank you.
Rich:
Hi Santos
I think this can be done with udev.
Create a file called /etc/udev/rules.d/98-keyboard-map.rules containing the following:
--- Code: ---ACTION=="add", SUBSYSTEM=="input", ENV{ID_INPUT_KEYBOARD}=="?*", RUN+="/usr/local/bin/setxkbmap es"
--- End code ---
Now make udev aware of the new rules file:
--- Code: ---sudo udevadm control --reload-rules
--- End code ---
Unplug your keyboard, count to 3, and plug it back in. See if the keyboard is correctly programmed.
If it looks correct, add the .rules file you created to your backup. Add the udevadm control --reload-rules
command to your bootlocal.sh file.
patrikg:
Have you tried to set the correct keyboard layout for X11.
Like this threads:
http://forum.tinycorelinux.net/index.php/topic,20065.msg124906.html#msg124906
http://forum.tinycorelinux.net/index.php/topic,24864.msg158216.html#msg158216
Rich:
Hi Santos
--- Quote from: Rich on February 05, 2022, 01:27:02 AM --- ... Create a file called /etc/udev/rules.d/98-keyboard-map.rules containing the following:
--- Code: ---ACTION=="add", SUBSYSTEM=="input", ENV{ID_INPUT_KEYBOARD}=="?*", RUN+="/usr/local/bin/setxkbmap es"
--- End code ---
...
--- End quote ---
It's possible you may have to do the RUN part a little differently:
Sorry, see attachment, forum error.
Santos:
Hello
--- Quote from: Rich on February 05, 2022, 10:25:02 AM ---...
It's possible you may have to do the RUN part a little differently:
Sorry, see attachment, forum error.
--- End quote ---
Thank you Rich. I did tried the first udev rule you shared. But didn't worked. I will try to test it again with the corrections. To have an alternative way of doing it.
--- Quote from: patrikg on February 05, 2022, 03:31:35 AM ---Have you tried to set the correct keyboard layout for X11.
Like this threads:
http://forum.tinycorelinux.net/index.php/topic,20065.msg124906.html#msg124906
http://forum.tinycorelinux.net/index.php/topic,24864.msg158216.html#msg158216
--- End quote ---
Thank you patrikg. It worked. The configuration file does make the keyboard layout persistent across Xorg soft and hard reset (exiting out) same with window manager or plugging keyboard in/out.
Thread can be marked as solved.
Navigation
[0] Message Index
[#] Next page
Go to full version