2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" >
4 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
6 <refentry id=
"org.freedesktop.locale1" conditional='ENABLE_LOCALED'
7 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
9 <title>org.freedesktop.locale1
</title>
10 <productname>systemd
</productname>
14 <refentrytitle>org.freedesktop.locale1
</refentrytitle>
15 <manvolnum>5</manvolnum>
19 <refname>org.freedesktop.locale1
</refname>
20 <refpurpose>The D-Bus interface of systemd-localed
</refpurpose>
24 <title>Introduction
</title>
27 <citerefentry><refentrytitle>systemd-localed.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
28 is a system service that can be used to control the system locale and keyboard mapping from user
29 programs. This page describes the D-Bus interface.
</para>
33 <title>The D-Bus API
</title>
35 <para>The service exposes the following interfaces on the bus:
</para>
38 $ gdbus introspect --system \
39 --dest org.freedesktop.locale1 \
40 --object-path /org/freedesktop/locale1
42 node /org/freedesktop/locale1 {
43 interface org.freedesktop.locale1 {
45 SetLocale(in as locale,
47 SetVConsoleKeyboard(in s keymap,
51 SetX11Keyboard(in s layout,
58 readonly as Locale = ['...', ...];
59 readonly s X11Layout = '...';
60 readonly s X11Model = '...';
61 readonly s X11Variant = '...';
62 readonly s X11Options = '...';
63 readonly s VConsoleKeymap = '...';
64 readonly s VConsoleKeymapToggle = '...';
66 interface org.freedesktop.DBus.Peer { ... };
67 interface org.freedesktop.DBus.Introspectable { ... };
68 interface org.freedesktop.DBus.Properties { ... };
73 <title>Methods
</title>
75 <para>If you set a new system locale all old system locale settings will be dropped, and the new
76 settings will be saved to disk. It will also be passed to the system manager, and subsequently started
77 daemons will inherit the new system locale. Note that already running daemons will not learn about the
80 <para>The
<function>SetVConsoleKeyboard()
</function> call may be used to set the key mapping on the
81 virtual console. Similarly,
<function>SetX11Keyboard()
</function> may be used to set the default key
82 mapping of the X11 servers.
</para>
84 <para>Note that
<function>SetVConsoleKeyboard()
</function> instantly applies the new keymapping to the
85 console, while
<function>SetX11Keyboard()
</function> simply sets a default that may be used by later
88 <para>The boolean argument
<varname>convert
</varname> may be set to optionally convert the console
89 keyboard configuration to X11 keyboard mappings and vice versa. If true and
90 <function>SetVConsoleKeyboard()
</function> is used the nearest X11 keyboard setting for the chosen
91 console setting is set. If true and
<function>SetX11Keyboard()
</function> is used, the nearest console
92 keyboard setting for the chosen X11 setting is set. Usually it is hence sufficient to call one of the
95 <para>For graphical UIs that need to set the system keyboard mapping simply invoke
96 <function>SetX11Keyboard()
</function>, set
<varname>convert=true
</varname> and ignore
97 <function>SetVConsoleKeyboard()
</function>.
</para>
99 <para>Use the empty string for the keymap parameters you wish not to set.
</para>
101 <para>The
<varname>interactive
</varname> boolean parameters can be used to control whether PolicyKit
102 should interactively ask the user for authentication credentials if it needs to.
</para>
106 <title>Signals
</title>
108 <para>Whenever the system locale or keymap is changed via the daemon,
109 <function>PropertyChanged
</function> signals are sent out to which clients can subscribe.
</para>
113 <title>Properties
</title>
115 <para>The system locale is shown in the
<varname>Locale
</varname> property. It is an array containing
116 environment-variable-assignment-like strings. The following strings are known:
117 <varname>LANG=
</varname>,
<varname>LC_CTYPE=
</varname>,
<varname>LC_NUMERIC=
</varname>,
118 <varname>LC_TIME=
</varname>,
<varname>LC_COLLATE=
</varname>,
<varname>LC_MONETARY=
</varname>,
119 <varname>LC_MESSAGES=
</varname>,
<varname>LC_PAPER=
</varname>,
<varname>LC_NAME=
</varname>,
120 <varname>LC_ADDRESS=
</varname>,
<varname>LC_TELEPHONE=
</varname>,
<varname>LC_MEASUREMENT=
</varname>,
121 <varname>LC_IDENTIFICATION=
</varname>.
</para>
123 <para>The
<varname>X11Layout
</varname>,
<varname>X11Model
</varname>,
<varname>X11Variant
</varname>, and
124 <varname>X11Options
</varname> properties show values configurable with
125 <function>SetX11Keyboard()
</function> described above (or
<function>SetVConsoleKeyboard()
</function>
126 with
<varname>convert=true
</varname>). The
<varname>VConsoleKeymap
</varname> and
127 <varname>VConsoleKeymapToggle
</varname> propries sohw values configurable with
128 <function>SetVConsoleKeyboard()
</function> (or
<function>SetX11Keyboard()
</function> with
129 <varname>convert=true
</varname>).
</para>
133 <title>Security
</title>
135 <para>Changing the system locale or keymap using this interface is authenticated via PolicyKit. The
136 PolicyKit action for
<function>SetLocale()
</function> is
137 <constant>org.freedesktop.locale1.set-locale
</constant>. The PolicyKit action for
138 <function>SetX11Keyboard()
</function> and
<function>SetVConsoleKeyboard()
</function> is
139 <constant>org.freedesktop.locale1.set-keyboard
</constant>.
</para>
144 <title>Versioning
</title>
146 <para>These D-Bus interfaces follow
<ulink url=
"http://0pointer.de/blog/projects/versioning-dbus.html">
147 the usual interface versioning guidelines
</ulink>.
</para>