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" />
115 <xi:include href=
"user-system-options.xml" xpointer=
"machine" />
117 <xi:include href=
"standard-options.xml" xpointer=
"help" />
118 <xi:include href=
"standard-options.xml" xpointer=
"version" />
119 <xi:include href=
"standard-options.xml" xpointer=
"no-pager" />
124 <title>Commands
</title>
126 <para>The following commands are understood:
</para>
130 <term><command>status
</command></term>
132 <listitem><para>Show current settings of the system locale and keyboard mapping.
133 If no command is specified, this is the implied default.
</para></listitem>
137 <term><command>set-locale LOCALEā¦
</command></term>
139 <listitem><para>Set the system locale. This takes one or more
140 assignments such as
"LANG=de_DE.utf8",
141 "LC_MESSAGES=en_GB.utf8", and so on. See
142 <citerefentry project='man-pages'
><refentrytitle>locale
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
143 for details on the available settings and their meanings. Use
144 <command>list-locales
</command> for a list of available
145 locales (see below).
</para></listitem>
149 <term><command>list-locales
</command></term>
151 <listitem><para>List available locales useful for
153 <command>set-locale
</command>.
</para></listitem>
157 <term><command>set-keymap MAP [TOGGLEMAP]
</command></term>
159 <listitem><para>Set the system keyboard mapping for the
160 console and X11. This takes a mapping name (such as
"de" or
161 "us"), and possibly a second one to define a toggle keyboard
162 mapping. Unless
<option>--no-convert
</option> is passed, the
163 selected setting is also applied as the default system
164 keyboard mapping of X11, after converting it to the closest
165 matching X11 keyboard mapping. Use
166 <command>list-keymaps
</command> for a list of available
167 keyboard mappings (see below).
</para></listitem>
171 <term><command>list-keymaps
</command></term>
173 <listitem><para>List available keyboard mappings for the
174 console, useful for configuration with
175 <command>set-keymap
</command>.
</para></listitem>
179 <term><command>set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]
</command></term>
181 <listitem><para>Set the system default keyboard mapping for
182 X11 and the virtual console. This takes a keyboard mapping
183 name (such as
<literal>de
</literal> or
<literal>us
</literal>),
184 and possibly a model, variant, and options, see
185 <citerefentry><refentrytitle>kbd
</refentrytitle><manvolnum>4</manvolnum></citerefentry>
186 for details. Unless
<option>--no-convert
</option> is passed,
187 the selected setting is also applied as the system console
188 keyboard mapping, after converting it to the closest matching
189 console keyboard mapping.
</para></listitem>
193 <term><command>list-x11-keymap-models
</command></term>
194 <term><command>list-x11-keymap-layouts
</command></term>
195 <term><command>list-x11-keymap-variants [LAYOUT]
</command></term>
196 <term><command>list-x11-keymap-options
</command></term>
198 <listitem><para>List available X11 keymap models, layouts,
199 variants and options, useful for configuration with
200 <command>set-keymap
</command>. The command
201 <command>list-x11-keymap-variants
</command> optionally takes a
202 layout parameter to limit the output to the variants suitable
203 for the specific layout.
</para></listitem>
210 <title>Exit status
</title>
212 <para>On success,
0 is returned, a non-zero failure code
216 <xi:include href=
"less-variables.xml" />
219 <title>See Also
</title>
221 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
222 <citerefentry project='man-pages'
><refentrytitle>locale
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
223 <citerefentry project='man-pages'
><refentrytitle>locale.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
224 <citerefentry><refentrytitle>vconsole.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
225 <citerefentry project='mankier'
><refentrytitle>loadkeys
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
226 <citerefentry><refentrytitle>kbd
</refentrytitle><manvolnum>4</manvolnum></citerefentry>,
227 <ulink url=
"http://www.x.org/releases/current/doc/xorg-docs/input/XKB-Config.html">
228 The XKB Configuration Guide
230 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
231 <citerefentry><refentrytitle>systemd-localed.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
232 <citerefentry><refentrytitle>systemd-firstboot
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
233 <citerefentry project='die-net'
><refentrytitle>mkinitrd
</refentrytitle><manvolnum>8</manvolnum></citerefentry>