Settingsđź”—

org.freedesktop.impl.portal.Settings

Settings portal backend interface

This interface provides read-only access to a small number of host settings required for toolkits similar to XSettings. It is not for general purpose settings.

Currently the interface provides the following keys:

  • org.freedesktop.appearance color-scheme (u)

    Indicates the system’s preferred color scheme. Supported values are:

    • 0: No preference

    • 1: Prefer dark appearance

    • 2: Prefer light appearance

    Unknown values should be treated as 0 (no preference).

  • org.freedesktop.appearance accent-color ((ddd))

    Indicates the system’s preferred accent color as a tuple of RGB values in the sRGB color space, in the range [0,1]. Out-of-range RGB values should be treated as an unset accent color.

  • org.freedesktop.appearance contrast (u)

    Indicates the system’s preferred contrast level. Supported values are:

    • 0: No preference (normal contrast)

    • 1: Higher contrast

    Unknown values should be treated as 0 (no preference).

  • org.freedesktop.appearance reduced-motion (u)

    Indicates the system’s preferred reduced motion setting. Supported values are:

    • 0: No preference

    • 1: Reduced motion

    Unknown values should be treated as 0 (no preference).

  • org.freedesktop.appearance button-placement ((asas))

    Indicates the system’s preferred arrangement of buttons on the titlebar. This is also used to tell apps what buttons should exist in the window controls, such that an application doesn’t draw certain buttons when it may not fit the desktop in use to do so.

    In LTR locales, the first tuple is on the left (leading), and the second tuple is on the right (trailing). In RTL locales, the first tuple is on the right (leading), and the second tuple is on the left (trailing). The drawing order of the buttons inside each tuple is left to the client. Supported values are:

    • close: The close button

    • minimize: The minimize button

    • maximize: The maximize button

    Unknown values must be ignored if the client does not understand them. Duplicate buttons across the tuples and string arrays may exist, but may be ignored by clients. Examples:

    • ([“close”,”minimize”,”maximize”][]) would result in the close, minimize, and maximize buttons being drawn on the leading side of the window, in that order; there will be no buttons on the trailing side of the window.

    • ([][“close”]) would result in the close button being drawn on the trailing side of the window; there will be no buttons on the leading side of the window.

    • ([“close”][“maximize”]) would result in the close button being drawn on the leading side of the window, and the maximize button being drawn on the trailing side of the window.

    • ([“close”, “maximize”], [“close”]) would result in the close and maximize buttons being drawn on the leading side of the window, and no button on the trailing side.

Implementations can provide other keys; they are entirely implementation details that are undocumented. If you are a toolkit and want to use this please open an issue.

Note that the Settings portal can operate without this backend, implementing it is optional.

Propertiesđź”—

versionđź”—

version readable u

Methodsđź”—

ReadAll()đź”—

ReadAll (
  IN namespaces as,
  OUT value a{sa{sv}}
)

If namespaces is an empty array or contains an empty string it matches all. Globbing is supported but only for trailing sections, e.g. “org.example.*”.

namespaces

List of namespaces to filter results by, supports simple globbing explained below.

value

Dictionary of namespaces to its keys and values.

Read()đź”—

Read (
  IN namespace s,
  IN key s,
  OUT value v
)

Reads a single value. Returns an error on any unknown namespace or key.

namespace

Namespace to look up key in.

key

The key to get.

value

The value key is set to.

Signalsđź”—

SettingChangedđź”—

SettingChanged (
  namespace s,
  key s,
  value v
)

Emitted when a setting changes.

namespace

Namespace of changed setting.

key

The key of changed setting.

value

The new value.