Configuración Regional del Sistema y Configuración del Teclado
Estos ajustes se pueden hacer modificando el fichero de configuración /etc/locale.conf
o usando la utilidad localectl. También puede fijar estos ajustes durante la instalación del sistema usando la interfaz gráfica de instalación, la interfaz de modo texto o los comandos Kickstart keyboard y lang. Vea en la link:https://docs.fedoraproject.org/en-US/fedora/fFedora 30/install-guide[Guía de Instalación Fedora] información sobre estas opciones.
Estableciendo la Configuración Regional del Sistema
Los ajustes de configuración regional de todo el sistema se almacenan en el archivo /etc/locale.conf
, que es leído al principio del arranque por el demonio systemd
daemon. Los ajustes de configuración regional configurados en /etc/locale.conf
son heredados por cada servicio o usuario a no ser que programas o usuarios concretos los anulen.
El formato básico del archivo /etc/locale.conf
es una lista separadas por salto de línea de asignaciones de variables. Por ejemplo, la configuración regional Alemana con los mensajes en Inglés se verá en /etc/locale.conf
como sigue:
LANG=de_DE.UTF-8 LC_MESSAGES=C
Aquí, la opción LC_MESSAGES determina la configuración regional usada para los mensajes de diagnóstico escritos en la salida estándar de error. Para especificar mas la configuración regional en /etc/locale.conf
usted puede usar muchas otras opciones, las más relevantes se resumen en in Opciones configurables en /etc/locale.conf. Vea en la página de manual locale(7)
información detallada sobre estas opciones. Advierta que la opción LC_ALL, que representa todas las posibles opciones, no debería ser configurada en /etc/locale.conf
.
Option | Description |
---|---|
LANG |
Provides a default value for the system locale. |
LC_COLLATE |
Changes the behavior of functions which compare strings in the local alphabet. |
LC_CTYPE |
Changes the behavior of the character handling and classification functions and the multibyte character functions. |
LC_NUMERIC |
Describes the way numbers are usually printed, with details such as decimal point versus decimal comma. |
LC_TIME |
Changes the display of the current time, 24-hour versus 12-hour clock. |
LC_MESSAGES |
Determines the locale used for diagnostic messages written to the standard error output. |
Displaying the Current Status
The localectl command can be used to query and change the system locale and keyboard layout settings. To show the current settings, use the status
option:
localectl status
The output of the previous command lists the currently set locale, keyboard layout configured for the console and for the X11 window system.
~]$ localectl status System Locale: LANG=en_US.UTF-8 VC Keymap: us X11 Layout: n/a
Listing Available Locales
To list all locales available for your system, type:
localectl list-locales
Imagine you want to select a specific English locale, but you are not sure if it is available on the system. You can check that by listing all English locales with the following command:
~]$ localectl list-locales | grep en_
en_AG
en_AG.utf8
en_AU
en_AU.iso88591
en_AU.utf8
en_BW
en_BW.iso88591
en_BW.utf8
output truncated
Setting the Locale
To set the default system locale, use the following command as root
:
localectlset-locale
LANG
=locale
Replace locale with the locale name, found with the localectl list-locales
command. The above syntax can also be used to configure parameters from Options configurable in /etc/locale.conf.
For example, if you want to set British English as your default locale, first find the name of this locale by using list-locales
. Then, as root
, type the command in the following form:
~]# localectl set-locale LANG=en_GB.utf8
Changing the Keyboard Layout
The keyboard layout settings enable the user to control the layout used on the text console and graphical user interfaces.
Displaying the Current Settings
As mentioned before, you can check your current keyboard layout configuration with the following command:
localectl status
In the following output, you can see the keyboard layout configured for the virtual console and for the X11 window system.
~]$ localectl status System Locale: LANG=en_US.utf8 VC Keymap: us X11 Layout: us
Listing Available Keymaps
To list all available keyboard layouts that can be configured on your system, type:
localectl list-keymaps
You can use grep to search the output of the previous command for a specific keymap name. There are often multiple keymaps compatible with your currently set locale. For example, to find available Czech keyboard layouts, type:
~]$ localectllist-keymaps
| grepcz
cz cz-cp1250 cz-lat2 cz-lat2-prog cz-qwerty cz-us-qwertz sunt5-cz-us sunt5-us-cz
Setting the Keymap
To set the default keyboard layout for your system, use the following command as root
:
localectl set-keymap
map
Replace map with the name of the keymap taken from the output of the localectl list-keymaps
command. Unless the --no-convert
option is passed, the selected setting is also applied to the default keyboard mapping of the X11 window system, after converting it to the closest matching X11 keyboard mapping. This also applies in reverse, you can specify both keymaps with the following command as root
:
localectl set-x11-keymap
map
If you want your X11 layout to differ from the console layout, use the --no-convert
option.
localectl--no-convert
set-x11-keymap
map
With this option, the X11 keymap is specified without changing the previous console layout setting.
Imagine you want to use German keyboard layout in the graphical interface, but for console operations you want to retain the US keymap. To do so, type as root
:
~]# localectl --no-convert set-x11-keymap de
Then you can verify if your setting was successful by checking the current status:
~]$ localectl status System Locale: LANG=de_DE.UTF-8 VC Keymap: us X11 Layout: de
Apart from keyboard layout (map), three other options can be specified:
localectl set-x11-keymap
map model variant options
Replace model with the keyboard model name, variant and options with keyboard variant and option components, which can be used to enhance the keyboard behavior. These options are not set by default. For more information on X11 Model, X11 Variant, and X11 Options see the kbd(4)
man page.
Recursos Adicionales
For more information on how to configure the keyboard layout on Fedora, see the resources listed below:
-
localectl
(1) — The manual page for the localectl command line utility documents how to use this tool to configure the system locale and keyboard layout. -
loadkeys
(1) — The manual page for the loadkeys command provides more information on how to use this tool to change the keyboard layout in a virtual console.