How to create a keyboard configuration file in Spanish in X.Org?

I don't use x11/hal so can't help you there (I use devd) but I set my keyboard layout in /etc/X11/xorg.conf, using the XkbModel, XkbLayout, XkbVariant options. Have a look at the XKB configuration guide.

For a list of all available options run less /usr/local/share/X11/xkb/rules/base.lst. I see that es and latam would both be valid XkbLayout values for Spanish keyboards.
 
LATAM means latin, and Spanish means spanish, its keyboard variables are different. :rolleyes:
 
I don't use x11/hal (I use rather devd), but you can find everything in /usr/local/share/X11/xkb/rules/base.lst. First, create the /etc/X11/xorg.conf.d directory: mkdir /etc/X11/xorg.conf.d. Then, create 10-keyboard.conf (Xorg reads .conf files in arithmetic order).
Code:
Section "InputDevice"
  Identifier "Keyboard0"
  Driver "kbd"
  Option "XkbModel" "pc105" # or pc104
  Option "XkbRules" "xorg"
  Option "XkbLayout" "es"
EndSection
In base.lst choose model, layout and if you need it variant layout (XkbVariant option). Below is an excerpt for a Spanish layout.

  • nodeadkeys es: Spanish (eliminate dead keys)
  • winkeys es: Spanish (Winkeys)
  • deadtilde es: Spanish (include dead tilde)
  • sundeadkeys es: Spanish (Sun dead keys)
  • dvorak es: Spanish (Dvorak)
  • ast es: Asturian (Spain, with bottom-dot H and bottom-dot L)
  • cat es: Catalan (Spain, with middle-dot L)
  • mac es: Spanish (Macintosh)
 
Last edited by a moderator:
Edit: olivierd beat me to it :)

LATAM means latin, and Spanish means spanish, its keyboard variables are different. :rolleyes:
I didn't want to assume which flavour of Spanish you speak :)

That it is necessary to add on base.lst ? :rolleyes:
No, if you're using x11/hal you need to create the file /usr/local/etc/hal/fdi/policy/x11-input.fdi with the content something like:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.keys">
      <merge key="input.x11_options.XkbRules" type="string">base</merge>
      <merge key="input.x11_options.XkbModel" type="string">pc105</merge>
      <merge key="input.x11_options.XkbLayout" type="string">es</merge>
      <merge key="input.x11_options.XkbVariant" type="string">winkeys</merge>
    </match>
  </device>
</deviceinfo>
 
x11/hal you need to create the file /usr/local/etc/hal/fdi/policy/x11-input.fdi with the content something like:
Code:
.26947/">
No, if you're using x11/hal you need to create the file /usr/local/etc/hal/fdi/policy/x11-input.fdi with the content something like:
Code:

olivierd: I did what you said and did not work.

asteriskRoss: can you specify how to create the directory /usr/local/etc/hal/fdi/policy/x11-input.fdi? The variable for the Spanish keyboard is es, and the variable for the LATAM keyboard is la. Localization of language is ISO-8859-15, and es_ES.ISO8859-15 or es_ES.UTF-8, thanks for the replies. :)
 
/usr/local/etc/hal/fdi/policy/x11-input.fdi should be a file, not a directory. You can create it using a text editor such as ee(1) or vi(1) from the console. If you're not already familiar with vi(1), then ee(1) is easier to use. I am not sure whether the /usr/local/etc/hal/fdi/policy directory is created when x11/hal is installed so my instructions include creating it, just in case.
  • As root, run mkdir -p /usr/local/etc/hal/fdi/policy.
  • As root, run ee /usr/local/etc/hal/fdi/policy/x11-input.fdi.
  • Type in the contents of the XML file from my previous post.
  • Press Escape to bring up the editor menu.
  • Press Enter to choose the first option and leave the editor.
  • Choose to save the file when prompted.
 
There's no port with x11/hal. At the beginning of this thread. How can I create a keyboard configuration file for hald called x11-input.fdi and saved in the /usr/local/etc/hal/fdi/policy directory? This file should contain the following lines:
 
  • Boot to FreeBSD.
  • Press Ctrl + Alt + F2 to switch to a console.
  • Login as root.
  • Run this command: mkdir -p /usr/local/etc/hal/fdi/policy.
  • Run this command: ee /usr/local/etc/hal/fdi/policy/x11-input.fdi.
  • Enter the following:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <deviceinfo version="0.2">
    <device>
    <match key="info.capabilities" contains="input.keys">
    <merge key="input.x11_options.XkbRules" type="string">base</merge>
    <merge key="input.x11_options.XkbModel" type="string">pc105</merge>
    <merge key="input.x11_options.XkbLayout" type="string">es</merge>
    <merge key="input.x11_options.XkbVariant" type="string">winkeys</merge>
    </match>
    </device>
    </deviceinfo>
  • Press Escape (this shows the menu).
  • Press Enter (this chooses the first option; leave editor).
  • Press Enter (this chooses the first option; save changes).
  • Run this command: shutdown -r now.
 
An excerpt for a Spanish layout is not shown, for example:
  • nodeadkeys es: Spanish (eliminate dead keys)
  • winkeys es: Spanish (Winkeys)
  • deadtilde es: Spanish (include dead tilde)
  • sundeadkeys es: Spanish (Sun dead keys)
  • dvorak es: Spanish (Dvorak)
  • ast es: Asturian (Spain, with bottom-dot H and bottom-dot L)
  • cat es: Catalan (Spain, with middle-dot L)
  • mac es: Spanish (Macintosh)

Also I have problems with language localization in a variable LC_ALL=, thanks for the help. :)

Code:
[cmd=%]locale[/cmd]
LANG=es_ES.ISO8859-15
LC_CTYPE="es_ES.ISO8859-15"
LC_COLLATE="es_ES.ISO8859-15"
LC_TIME="es_ES.ISO8859-15"
LC_NUMERIC="es_ES.ISO8859-15"
LC_MONETARY="es_ES.ISO8859-15"
LC_MESSAGES="es_ES.ISO8859-15"
LC_ALL=
%
 
The Spanish layout is 'es'. You do not need to specify any variant.

Do not worry about LC_ALL. See the Chapters 23.2.1.1. Login Classes Method and 23.2.2. Console Setup in the Handbook. In my .xinitrc I have this line before invoking the WM:
Code:
setxkbmap -model pc105 -layout es -option terminate:ctrl_alt_bksp &
 
Thanks for mentioning the XKB Configuration guide. I just set up my laptop, using devd-based device detection for Xorg (finally - a good replacement for HAL) and struggled a bit with setting up a national keyboard layout in /etc/X11/xorg.conf. I added this section and got a working "no" layout:
Code:
Section "InputClass"
  Identifier "keyboard defaults"
  MatchIsKeyboard "on"
  Option  "XkbLayout" "no"
EndSection
 
Back
Top