2020-04-09 18:43:52 +03:00
<?xml version='1.0'?>
< !DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" >
2020-11-09 07:23:58 +03:00
<!-- SPDX - License - Identifier: LGPL - 2.1 - or - later -->
2020-04-09 18:43:52 +03:00
<refentry id= "org.freedesktop.locale1" conditional= 'ENABLE_LOCALED'
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo >
<title > org.freedesktop.locale1</title>
<productname > systemd</productname>
</refentryinfo>
<refmeta >
<refentrytitle > org.freedesktop.locale1</refentrytitle>
<manvolnum > 5</manvolnum>
</refmeta>
<refnamediv >
<refname > org.freedesktop.locale1</refname>
<refpurpose > The D-Bus interface of systemd-localed</refpurpose>
</refnamediv>
<refsect1 >
<title > Introduction</title>
<para >
<citerefentry > <refentrytitle > systemd-localed.service</refentrytitle> <manvolnum > 8</manvolnum> </citerefentry>
is a system service that can be used to control the system locale and keyboard mapping from user
programs. This page describes the D-Bus interface.</para>
</refsect1>
<refsect1 >
<title > The D-Bus API</title>
<para > The service exposes the following interfaces on the bus:</para>
2020-04-24 13:08:10 +03:00
<programlisting executable= "systemd-localed" node= "/org/freedesktop/locale1" interface= "org.freedesktop.locale1" >
2020-04-09 18:43:52 +03:00
node /org/freedesktop/locale1 {
interface org.freedesktop.locale1 {
methods:
SetLocale(in as locale,
2020-04-10 16:07:03 +03:00
in b interactive);
2020-04-09 18:43:52 +03:00
SetVConsoleKeyboard(in s keymap,
in s keymap_toggle,
in b convert,
2020-04-10 16:07:03 +03:00
in b interactive);
2020-04-09 18:43:52 +03:00
SetX11Keyboard(in s layout,
in s model,
in s variant,
in s options,
in b convert,
2020-04-10 16:07:03 +03:00
in b interactive);
2020-04-09 18:43:52 +03:00
properties:
2020-04-10 16:07:03 +03:00
readonly as Locale = ['...', ...];
readonly s X11Layout = '...';
readonly s X11Model = '...';
readonly s X11Variant = '...';
readonly s X11Options = '...';
readonly s VConsoleKeymap = '...';
readonly s VConsoleKeymapToggle = '...';
2020-04-09 18:43:52 +03:00
};
2020-04-10 16:07:03 +03:00
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
interface org.freedesktop.DBus.Properties { ... };
2020-04-09 18:43:52 +03:00
};
</programlisting>
2020-04-21 11:29:09 +03:00
<!-- Autogenerated cross - references for systemd.directives, do not edit -->
<variablelist class= "dbus-interface" generated= "True" extra-ref= "org.freedesktop.locale1" />
<variablelist class= "dbus-interface" generated= "True" extra-ref= "org.freedesktop.locale1" />
<variablelist class= "dbus-method" generated= "True" extra-ref= "SetLocale()" />
<variablelist class= "dbus-method" generated= "True" extra-ref= "SetVConsoleKeyboard()" />
<variablelist class= "dbus-method" generated= "True" extra-ref= "SetX11Keyboard()" />
<variablelist class= "dbus-property" generated= "True" extra-ref= "Locale" />
<variablelist class= "dbus-property" generated= "True" extra-ref= "X11Layout" />
<variablelist class= "dbus-property" generated= "True" extra-ref= "X11Model" />
<variablelist class= "dbus-property" generated= "True" extra-ref= "X11Variant" />
<variablelist class= "dbus-property" generated= "True" extra-ref= "X11Options" />
<variablelist class= "dbus-property" generated= "True" extra-ref= "VConsoleKeymap" />
<variablelist class= "dbus-property" generated= "True" extra-ref= "VConsoleKeymapToggle" />
<!-- End of Autogenerated section -->
2020-04-09 18:43:52 +03:00
<refsect2 >
<title > Methods</title>
2020-04-14 14:43:11 +03:00
<para > If you set a new system locale all old system locale settings will be dropped and the new
settings will be saved to disk. The locale will also be passed to the system manager, and subsequently started
2020-04-12 17:24:14 +03:00
daemons will inherit the new system locale. Note that already running daemons will not learn about the
new value.</para>
2020-04-09 18:43:52 +03:00
2020-04-19 14:05:20 +03:00
<para > The <function > SetVConsoleKeyboard()</function> method may be used to set the key mapping for the
2020-04-09 18:43:52 +03:00
virtual console. Similarly, <function > SetX11Keyboard()</function> may be used to set the default key
2020-04-14 14:43:11 +03:00
mapping of any X11 servers.</para>
2020-04-09 18:43:52 +03:00
2020-04-14 14:43:11 +03:00
<para > Note that <function > SetVConsoleKeyboard()</function> instantly applies the new key mapping to the
2020-04-09 18:43:52 +03:00
console, while <function > SetX11Keyboard()</function> simply sets a default that may be used by later
sessions.</para>
<para > The boolean argument <varname > convert</varname> may be set to optionally convert the console
2020-04-12 17:24:14 +03:00
keyboard configuration to X11 keyboard mappings and vice versa. If true and
2020-04-14 14:43:11 +03:00
<function > SetVConsoleKeyboard()</function> is used, the nearest X11 keyboard setting for the chosen
2020-04-09 18:43:52 +03:00
console setting is set. If true and <function > SetX11Keyboard()</function> is used, the nearest console
2020-04-14 14:43:11 +03:00
keyboard setting for the chosen X11 setting is set. Hence, it is usually sufficient to call only one of the
2020-04-09 18:43:52 +03:00
two functions.</para>
<para > For graphical UIs that need to set the system keyboard mapping simply invoke
<function > SetX11Keyboard()</function> , set <varname > convert=true</varname> and ignore
<function > SetVConsoleKeyboard()</function> .</para>
<para > Use the empty string for the keymap parameters you wish not to set.</para>
2020-04-18 18:47:51 +03:00
<para > The <varname > interactive</varname> boolean parameters can be used to control whether
<ulink url= "https://www.freedesktop.org/software/polkit/docs/latest/" > polkit</ulink>
2020-04-14 14:43:11 +03:00
should interactively ask the user for authentication credentials if required.</para>
2020-04-12 17:24:14 +03:00
</refsect2>
<refsect2 >
<title > Signals</title>
<para > Whenever the system locale or keymap is changed via the daemon,
<function > PropertyChanged</function> signals are sent out to which clients can subscribe.</para>
</refsect2>
<refsect2 >
<title > Properties</title>
<para > The system locale is shown in the <varname > Locale</varname> property. It is an array containing
environment-variable-assignment-like strings. The following strings are known:
<varname > LANG=</varname> , <varname > LC_CTYPE=</varname> , <varname > LC_NUMERIC=</varname> ,
<varname > LC_TIME=</varname> , <varname > LC_COLLATE=</varname> , <varname > LC_MONETARY=</varname> ,
<varname > LC_MESSAGES=</varname> , <varname > LC_PAPER=</varname> , <varname > LC_NAME=</varname> ,
<varname > LC_ADDRESS=</varname> , <varname > LC_TELEPHONE=</varname> , <varname > LC_MEASUREMENT=</varname> ,
<varname > LC_IDENTIFICATION=</varname> .</para>
<para > The <varname > X11Layout</varname> , <varname > X11Model</varname> , <varname > X11Variant</varname> , and
<varname > X11Options</varname> properties show values configurable with
<function > SetX11Keyboard()</function> described above (or <function > SetVConsoleKeyboard()</function>
with <varname > convert=true</varname> ). The <varname > VConsoleKeymap</varname> and
2020-04-14 14:43:11 +03:00
<varname > VConsoleKeymapToggle</varname> properties show values configurable with
2020-04-12 17:24:14 +03:00
<function > SetVConsoleKeyboard()</function> (or <function > SetX11Keyboard()</function> with
<varname > convert=true</varname> ).</para>
</refsect2>
<refsect2 >
<title > Security</title>
2020-04-18 18:47:51 +03:00
<para > Changing the system locale or keymap using this interface is authenticated via polkit. The
polkit action for <function > SetLocale()</function> is
<constant > org.freedesktop.locale1.set-locale</constant> . The polkit action for
2020-04-09 18:43:52 +03:00
<function > SetX11Keyboard()</function> and <function > SetVConsoleKeyboard()</function> is
<constant > org.freedesktop.locale1.set-keyboard</constant> .</para>
</refsect2>
</refsect1>
2020-04-24 13:08:10 +03:00
<refsect1 >
<title > Examples</title>
<example >
<title > Introspect <interfacename > org.freedesktop.locale1</interfacename> on the bus</title>
<programlisting >
$ gdbus introspect --system \
--dest org.freedesktop.locale1 \
--object-path /org/freedesktop/locale1
</programlisting>
</example>
</refsect1>
2020-04-09 18:43:52 +03:00
<refsect1 >
<title > Versioning</title>
<para > These D-Bus interfaces follow <ulink url= "http://0pointer.de/blog/projects/versioning-dbus.html" >
the usual interface versioning guidelines</ulink> .</para>
</refsect1>
</refentry>