LOCALED(8)

NAME
localed - D-Bus locale and keyboard management daemon for non-systemd Linux systems

SYNOPSIS
/usr/libexec/localed [--debug]

DESCRIPTION
localed is a standalone system daemon that implements the org.freedesktop.locale1 D-Bus interface using direct D-Bus activation, with no dependency on systemd. It exposes the same locale and keyboard properties as systemd-localed(8) on systemd-based distributions, allowing desktop tools such as gnome-control-center to read and edit the system locale and keyboard configuration on systems that use elogind and a D-Bus/PolKit stack without systemd.

localed does not poll or hold any files open for writing on its own initiative. Instead it watches its source files with inotify(7) and re-reads them whenever they change, regardless of who changed them — the bundled localectl(1) client, a hand edit, or any other tool. After a resync it emits PropertiesChanged on the D-Bus object for every property whose value actually changed.

localed is normally started on demand by D-Bus activation when a client first calls a method or reads a property on the org.freedesktop.locale1 bus name. It can also be started manually for debugging.

OPTIONS

--debug
    Enable verbose debug logging to standard error in addition to syslog.

D-BUS INTERFACE
localed registers the object /org/freedesktop/locale1 on the system bus, implementing the org.freedesktop.locale1 interface.

  Properties
All properties are read-only over D-Bus; values are changed via the Set* methods described below, or by editing the underlying files directly (see FILES), which localed picks up automatically via inotify.

Locale (as)
    An array of `KEY=value' strings describing the active locale settings. Keys are drawn from the standard set: LANG, LANGUAGE, LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT, and LC_IDENTIFICATION. Only keys with non-empty values are included in the array; absent keys are not emitted as empty strings. Values are read from /etc/locale.conf (see FILES).

VConsoleKeymap (s)
    The primary virtual console keymap name, read from the KEYMAP key in /etc/vconsole.conf.

VConsoleKeymapToggle (s)
    The secondary (toggle) console keymap, read from the KEYMAP_TOGGLE key in /etc/vconsole.conf. May be empty.

X11Layout (s)
    The XkbLayout string (e.g. `us', `de', `gb,us') read from the Xorg InputClass config file (see FILES).

X11Model (s)
    The XkbModel string (e.g. `pc105').

X11Variant (s)
    The XkbVariant string (e.g. `intl' or `nodeadkeys'). May be empty.

X11Options (s)
    The XkbOptions string (e.g. `terminate:ctrl_alt_bksp,compose:ralt'). May be empty.

  Methods

SetLocale(as locale, b interactive)
    Validates and writes the given locale assignments to /etc/locale.conf. Each element of locale must be of the form KEY=value, where KEY is one of the fourteen known locale variable names and value uses only alphanumerics plus _,.,-,@,:,. An empty value removes that key from the file. Unknown keys cause the entire call to fail. Requires the org.freedesktop.locale1.set-locale PolKit action.

SetVConsoleKeyboard(s keymap, s keymap_toggle, b convert, b interactive)
    Writes keymap and keymap_toggle to /etc/vconsole.conf. When convert is true and keymap is non-empty, a matching X11 layout is derived from the built-in conversion table and written to the Xorg keyboard config file. The conversion is best-effort; if no mapping exists for keymap, the X11 file is left unmodified. Requires the org.freedesktop.locale1.set-keyboard PolKit action.

SetX11Keyboard(s layout, s model, s variant, s options, b convert, b interactive)
    Writes the Xorg InputClass keyboard stanza (XkbLayout, XkbModel, XkbVariant, XkbOptions) to the keyboard config file. When convert is true and layout is non-empty, a matching console keymap is derived from the built-in conversion table and written to /etc/vconsole.conf. Requires the org.freedesktop.locale1.set-keyboard PolKit action.

For every method that takes an interactive argument, a value of true indicates the caller is willing to wait for a PolKit authentication dialog; a value of false means the call fails immediately with org.freedesktop.DBus.Error.AuthFailed unless the caller is already authorised.

AUTHORIZATION
Access to the Set* methods over D-Bus is controlled by polkit(8) using the following actions, declared in /usr/share/polkit-1/actions/org.freedesktop.locale1.policy:

org.freedesktop.locale1.set-locale
org.freedesktop.locale1.set-keyboard

By default these actions require auth_admin for inactive or remote callers and auth_admin_keep for an active local session, matching upstream systemd-localed(8) policy. A PolKit rule installed at /usr/share/polkit-1/rules.d/org.freedesktop.locale1.rules additionally grants unconditional access to members of the privileged group selected at build time (default `wheel', see the privileged-group meson option), so desktop session tools are not prompted for a password on every locale or keyboard change. Group membership changes only take effect for new login sessions.

These PolKit actions govern D-Bus callers only. The bundled localectl(1) client bypasses D-Bus entirely and writes the underlying files directly; its own authorization is ordinary Unix file permissions, meaning it requires root for every write subcommand.

FILES

/etc/locale.conf
    System locale settings, stored as KEY=value assignments. Read for the Locale property; written atomically by SetLocale and by localectl(1). Watched with inotify(7).

/etc/rc.d/rc.keymap
    Slackware console keyboard script. Called by the boot process to load the keyboard map via loadkeys(1). localed parses the loadkeys argument for the VConsoleKeymap property and regenerates the script atomically when SetVConsoleKeyboard is called. Watched with inotify(7).

/etc/rc.d/rc.keymap.toggle
    Sidecar file persisting VConsoleKeymapToggle across reboots. Contains the bare keymap name on a single line. Absent when no toggle keymap is configured. Created and managed exclusively by localed. Slackware has no native toggle-keymap concept.

/etc/X11/xorg.conf.d/00-keyboard.conf
    Xorg InputClass stanza describing the X11 keyboard layout. Written in the canonical format used by systemd-localed(8) so Xorg picks it up on next start. Watched with inotify(7). The directory is created automatically if it does not exist when SetX11Keyboard is called.

/usr/share/polkit-1/actions/org.freedesktop.locale1.policy
    PolKit action declarations and default authorization requirements.

/usr/share/polkit-1/rules.d/org.freedesktop.locale1.rules
    PolKit rule granting the configured privileged group unconditional access to both locale1 actions.

SEE ALSO
localectl(1), locale.conf(5), vconsole.conf(5), polkit(8), pkcheck(1), inotify(7)

AUTHOR
Nathaniel Russell <naterussell83@gmail.com>

LICENSE
This program is free software, distributed under the GNU General Public License, version 2 or later. See the source for copying conditions.

BUGS
Report bugs at https://github.com/nater1983/localed.