]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/org.freedesktop.locale1.xml
man: locale1(5) — adjust page structure and fill in the missing parts
[thirdparty/systemd.git] / man / org.freedesktop.locale1.xml
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+ -->
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>
38 $ gdbus introspect --system \
39 --dest org.freedesktop.locale1 \
40 --object-path /org/freedesktop/locale1
41
42 node /org/freedesktop/locale1 {
43 interface org.freedesktop.locale1 {
44 methods:
45 SetLocale(in as locale,
46 in b interactive);
47 SetVConsoleKeyboard(in s keymap,
48 in s keymap_toggle,
49 in b convert,
50 in b interactive);
51 SetX11Keyboard(in s layout,
52 in s model,
53 in s variant,
54 in s options,
55 in b convert,
56 in b interactive);
57 properties:
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 = '...';
65 };
66 interface org.freedesktop.DBus.Peer { ... };
67 interface org.freedesktop.DBus.Introspectable { ... };
68 interface org.freedesktop.DBus.Properties { ... };
69 };
70 </programlisting>
71
72 <refsect2>
73 <title>Methods</title>
74
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
78 new value.</para>
79
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>
83
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
86 sessions.</para>
87
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
93 two functions.</para>
94
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>
98
99 <para>Use the empty string for the keymap parameters you wish not to set.</para>
100
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>
103 </refsect2>
104
105 <refsect2>
106 <title>Signals</title>
107
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>
110 </refsect2>
111
112 <refsect2>
113 <title>Properties</title>
114
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>
122
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>
130 </refsect2>
131
132 <refsect2>
133 <title>Security</title>
134
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>
140 </refsect2>
141 </refsect1>
142
143 <refsect1>
144 <title>Versioning</title>
145
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>
148 </refsect1>
149 </refentry>