1<?xml version='1.0'?>
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-or-later -->
5
6<refentry id="org.freedesktop.locale1" conditional='ENABLE_LOCALED'
7    xmlns:xi="http://www.w3.org/2001/XInclude">
8  <refentryinfo>
9    <title>org.freedesktop.locale1</title>
10    <productname>systemd</productname>
11  </refentryinfo>
12
13  <refmeta>
14    <refentrytitle>org.freedesktop.locale1</refentrytitle>
15    <manvolnum>5</manvolnum>
16  </refmeta>
17
18  <refnamediv>
19    <refname>org.freedesktop.locale1</refname>
20    <refpurpose>The D-Bus interface of systemd-localed</refpurpose>
21  </refnamediv>
22
23  <refsect1>
24    <title>Introduction</title>
25
26    <para>
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>
30  </refsect1>
31
32  <refsect1>
33    <title>The D-Bus API</title>
34
35    <para>The service exposes the following interfaces on the bus:</para>
36
37    <programlisting executable="systemd-localed" node="/org/freedesktop/locale1" interface="org.freedesktop.locale1">
38node /org/freedesktop/locale1 {
39  interface org.freedesktop.locale1 {
40    methods:
41      SetLocale(in  as locale,
42                in  b interactive);
43      SetVConsoleKeyboard(in  s keymap,
44                          in  s keymap_toggle,
45                          in  b convert,
46                          in  b interactive);
47      SetX11Keyboard(in  s layout,
48                     in  s model,
49                     in  s variant,
50                     in  s options,
51                     in  b convert,
52                     in  b interactive);
53    properties:
54      readonly as Locale = ['...', ...];
55      readonly s X11Layout = '...';
56      readonly s X11Model = '...';
57      readonly s X11Variant = '...';
58      readonly s X11Options = '...';
59      readonly s VConsoleKeymap = '...';
60      readonly s VConsoleKeymapToggle = '...';
61  };
62  interface org.freedesktop.DBus.Peer { ... };
63  interface org.freedesktop.DBus.Introspectable { ... };
64  interface org.freedesktop.DBus.Properties { ... };
65};
66    </programlisting>
67
68    <!--Autogenerated cross-references for systemd.directives, do not edit-->
69
70    <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.locale1"/>
71
72    <variablelist class="dbus-interface" generated="True" extra-ref="org.freedesktop.locale1"/>
73
74    <variablelist class="dbus-method" generated="True" extra-ref="SetLocale()"/>
75
76    <variablelist class="dbus-method" generated="True" extra-ref="SetVConsoleKeyboard()"/>
77
78    <variablelist class="dbus-method" generated="True" extra-ref="SetX11Keyboard()"/>
79
80    <variablelist class="dbus-property" generated="True" extra-ref="Locale"/>
81
82    <variablelist class="dbus-property" generated="True" extra-ref="X11Layout"/>
83
84    <variablelist class="dbus-property" generated="True" extra-ref="X11Model"/>
85
86    <variablelist class="dbus-property" generated="True" extra-ref="X11Variant"/>
87
88    <variablelist class="dbus-property" generated="True" extra-ref="X11Options"/>
89
90    <variablelist class="dbus-property" generated="True" extra-ref="VConsoleKeymap"/>
91
92    <variablelist class="dbus-property" generated="True" extra-ref="VConsoleKeymapToggle"/>
93
94    <!--End of Autogenerated section-->
95
96    <refsect2>
97      <title>Methods</title>
98
99      <para>If you set a new system locale all old system locale settings will be dropped and the new
100      settings will be saved to disk. The locale will also be passed to the system manager, and subsequently started
101      daemons will inherit the new system locale. Note that already running daemons will not learn about the
102      new value.</para>
103
104      <para>The <function>SetVConsoleKeyboard()</function> method may be used to set the key mapping for the
105      virtual console. Similarly, <function>SetX11Keyboard()</function> may be used to set the default key
106      mapping of any X11 servers.</para>
107
108      <para>Note that <function>SetVConsoleKeyboard()</function> instantly applies the new key mapping to the
109      console, while <function>SetX11Keyboard()</function> simply sets a default that may be used by later
110      sessions.</para>
111
112      <para>The boolean argument <varname>convert</varname> may be set to optionally convert the console
113      keyboard configuration to X11 keyboard mappings and vice versa. If true and
114      <function>SetVConsoleKeyboard()</function> is used, the nearest X11 keyboard setting for the chosen
115      console setting is set. If true and <function>SetX11Keyboard()</function> is used, the nearest console
116      keyboard setting for the chosen X11 setting is set. Hence, it is usually sufficient to call only one of the
117      two functions.</para>
118
119      <para>For graphical UIs that need to set the system keyboard mapping simply invoke
120      <function>SetX11Keyboard()</function>, set <varname>convert=true</varname> and ignore
121      <function>SetVConsoleKeyboard()</function>.</para>
122
123      <para>Use the empty string for the keymap parameters you wish not to set.</para>
124
125      <para>The <varname>interactive</varname> boolean parameters can be used to control whether
126      <ulink url="https://www.freedesktop.org/software/polkit/docs/latest/">polkit</ulink>
127      should interactively ask the user for authentication credentials if required.</para>
128    </refsect2>
129
130    <refsect2>
131      <title>Signals</title>
132
133      <para>Whenever the system locale or keymap is changed via the daemon,
134      <function>PropertyChanged</function> signals are sent out to which clients can subscribe.</para>
135    </refsect2>
136
137    <refsect2>
138      <title>Properties</title>
139
140      <para>The system locale is shown in the <varname>Locale</varname> property. It is an array containing
141      environment-variable-assignment-like strings. The following strings are known:
142      <varname>LANG=</varname>, <varname>LC_CTYPE=</varname>, <varname>LC_NUMERIC=</varname>,
143      <varname>LC_TIME=</varname>, <varname>LC_COLLATE=</varname>, <varname>LC_MONETARY=</varname>,
144      <varname>LC_MESSAGES=</varname>, <varname>LC_PAPER=</varname>, <varname>LC_NAME=</varname>,
145      <varname>LC_ADDRESS=</varname>, <varname>LC_TELEPHONE=</varname>, <varname>LC_MEASUREMENT=</varname>,
146      <varname>LC_IDENTIFICATION=</varname>.</para>
147
148      <para>The <varname>X11Layout</varname>, <varname>X11Model</varname>, <varname>X11Variant</varname>, and
149      <varname>X11Options</varname> properties show values configurable with
150      <function>SetX11Keyboard()</function> described above (or <function>SetVConsoleKeyboard()</function>
151      with <varname>convert=true</varname>). The <varname>VConsoleKeymap</varname> and
152      <varname>VConsoleKeymapToggle</varname> properties show values configurable with
153      <function>SetVConsoleKeyboard()</function> (or <function>SetX11Keyboard()</function> with
154      <varname>convert=true</varname>).</para>
155    </refsect2>
156
157    <refsect2>
158      <title>Security</title>
159
160      <para>Changing the system locale or keymap using this interface is authenticated via polkit. The
161      polkit action for <function>SetLocale()</function> is
162      <constant>org.freedesktop.locale1.set-locale</constant>. The polkit action for
163      <function>SetX11Keyboard()</function> and <function>SetVConsoleKeyboard()</function> is
164      <constant>org.freedesktop.locale1.set-keyboard</constant>.</para>
165    </refsect2>
166  </refsect1>
167
168  <refsect1>
169    <title>Examples</title>
170
171    <example>
172      <title>Introspect <interfacename>org.freedesktop.locale1</interfacename> on the bus</title>
173
174      <programlisting>
175$ gdbus introspect --system \
176  --dest org.freedesktop.locale1 \
177  --object-path /org/freedesktop/locale1
178      </programlisting>
179    </example>
180  </refsect1>
181
182  <refsect1 id="versioning">
183    <title>Versioning</title>
184
185    <para>These D-Bus interfaces follow <ulink url="http://0pointer.de/blog/projects/versioning-dbus.html">
186    the usual interface versioning guidelines</ulink>.</para>
187  </refsect1>
188</refentry>
189