1 <?xml version='
1.0'
?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 SPDX-License-Identifier: LGPL-2.1+
8 This file is part of systemd.
10 Copyright 2012 Lennart Poettering
12 systemd is free software; you can redistribute it and/or modify it
13 under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation; either version 2.1 of the License, or
15 (at your option) any later version.
17 systemd is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public License
23 along with systemd; If not, see <http://www.gnu.org/licenses/>.
26 <refentry id=
"localectl" conditional='ENABLE_LOCALED'
27 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
30 <title>localectl
</title>
31 <productname>systemd
</productname>
35 <contrib>Developer
</contrib>
36 <firstname>Lennart
</firstname>
37 <surname>Poettering
</surname>
38 <email>lennart@poettering.net
</email>
44 <refentrytitle>localectl
</refentrytitle>
45 <manvolnum>1</manvolnum>
49 <refname>localectl
</refname>
50 <refpurpose>Control the system locale and keyboard layout settings
</refpurpose>
55 <command>localectl
</command>
56 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
57 <arg choice=
"req">COMMAND
</arg>
62 <title>Description
</title>
64 <para><command>localectl
</command> may be used to query and change
65 the system locale and keyboard layout settings. It communicates with
66 <citerefentry><refentrytitle>systemd-localed
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
67 to modify files such as
<filename>/etc/locale.conf
</filename> and
68 <filename>/etc/vconsole.conf
</filename>.
</para>
70 <para>The system locale controls the language settings of system
71 services and of the UI before the user logs in, such as the
72 display manager, as well as the default for users after
75 <para>The keyboard settings control the keyboard layout used on
76 the text console and of the graphical UI before the user logs in,
77 such as the display manager, as well as the default for users
80 <para>Note that the changes performed using this tool might require
81 the initramfs to be rebuilt to take effect during early system boot.
82 The initramfs is not rebuilt automatically by
<filename>localectl
</filename>.
86 <citerefentry><refentrytitle>systemd-firstboot
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
87 may be used to initialize the system locale for mounted (but not booted)
92 <title>Options
</title>
94 <para>The following options are understood:
</para>
98 <term><option>--no-ask-password
</option></term>
100 <listitem><para>Do not query the user for authentication for
101 privileged operations.
</para></listitem>
105 <term><option>--no-convert
</option></term>
107 <listitem><para>If
<command>set-keymap
</command> or
108 <command>set-x11-keymap
</command> is invoked and this option
109 is passed, then the keymap will not be converted from the
110 console to X11, or X11 to console,
111 respectively.
</para></listitem>
114 <xi:include href=
"user-system-options.xml" xpointer=
"host" />
116 <xi:include href=
"standard-options.xml" xpointer=
"help" />
117 <xi:include href=
"standard-options.xml" xpointer=
"version" />
118 <xi:include href=
"standard-options.xml" xpointer=
"no-pager" />
121 <para>The following commands are understood:
</para>
125 <term><command>status
</command></term>
127 <listitem><para>Show current settings of the system locale and
128 keyboard mapping.
</para></listitem>
132 <term><command>set-locale LOCALEā¦
</command></term>
134 <listitem><para>Set the system locale. This takes one or more
135 assignments such as
"LANG=de_DE.utf8",
136 "LC_MESSAGES=en_GB.utf8", and so on. See
137 <citerefentry project='man-pages'
><refentrytitle>locale
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
138 for details on the available settings and their meanings. Use
139 <command>list-locales
</command> for a list of available
140 locales (see below).
</para></listitem>
144 <term><command>list-locales
</command></term>
146 <listitem><para>List available locales useful for
148 <command>set-locale
</command>.
</para></listitem>
152 <term><command>set-keymap MAP [TOGGLEMAP]
</command></term>
154 <listitem><para>Set the system keyboard mapping for the
155 console and X11. This takes a mapping name (such as
"de" or
156 "us"), and possibly a second one to define a toggle keyboard
157 mapping. Unless
<option>--no-convert
</option> is passed, the
158 selected setting is also applied as the default system
159 keyboard mapping of X11, after converting it to the closest
160 matching X11 keyboard mapping. Use
161 <command>list-keymaps
</command> for a list of available
162 keyboard mappings (see below).
</para></listitem>
166 <term><command>list-keymaps
</command></term>
168 <listitem><para>List available keyboard mappings for the
169 console, useful for configuration with
170 <command>set-keymap
</command>.
</para></listitem>
174 <term><command>set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]
</command></term>
176 <listitem><para>Set the system default keyboard mapping for
177 X11 and the virtual console. This takes a keyboard mapping
178 name (such as
<literal>de
</literal> or
<literal>us
</literal>),
179 and possibly a model, variant, and options, see
180 <citerefentry><refentrytitle>kbd
</refentrytitle><manvolnum>4</manvolnum></citerefentry>
181 for details. Unless
<option>--no-convert
</option> is passed,
182 the selected setting is also applied as the system console
183 keyboard mapping, after converting it to the closest matching
184 console keyboard mapping.
</para></listitem>
188 <term><command>list-x11-keymap-models
</command></term>
189 <term><command>list-x11-keymap-layouts
</command></term>
190 <term><command>list-x11-keymap-variants [LAYOUT]
</command></term>
191 <term><command>list-x11-keymap-options
</command></term>
193 <listitem><para>List available X11 keymap models, layouts,
194 variants and options, useful for configuration with
195 <command>set-keymap
</command>. The command
196 <command>list-x11-keymap-variants
</command> optionally takes a
197 layout parameter to limit the output to the variants suitable
198 for the specific layout.
</para></listitem>
205 <title>Exit status
</title>
207 <para>On success,
0 is returned, a non-zero failure code
211 <xi:include href=
"less-variables.xml" />
214 <title>See Also
</title>
216 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
217 <citerefentry project='man-pages'
><refentrytitle>locale
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
218 <citerefentry project='man-pages'
><refentrytitle>locale.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
219 <citerefentry><refentrytitle>vconsole.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
220 <citerefentry project='mankier'
><refentrytitle>loadkeys
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
221 <citerefentry><refentrytitle>kbd
</refentrytitle><manvolnum>4</manvolnum></citerefentry>,
222 <ulink url=
"http://www.x.org/releases/current/doc/xorg-docs/input/XKB-Config.html">
223 The XKB Configuration Guide
225 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
226 <citerefentry><refentrytitle>systemd-localed.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
227 <citerefentry><refentrytitle>systemd-firstboot
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
228 <citerefentry project='die-net'
><refentrytitle>mkinitrd
</refentrytitle><manvolnum>8</manvolnum></citerefentry>