community.general.xfconf (8.5.0) — module

Edit XFCE4 Configurations

Authors: Joseph Benden (@jbenden), Alexei Znamensky (@russoz)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

This module allows for the manipulation of Xfce 4 Configuration with the help of xfconf-query. Please see the xfconf-query(1) man page for more details.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Change the DPI to "192"
  xfconf:
    channel: "xsettings"
    property: "/Xft/DPI"
    value_type: "int"
    value: "192"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set workspace names (4)
  xfconf:
    channel: xfwm4
    property: /general/workspace_names
    value_type: string
    value: ['Main', 'Work1', 'Work2', 'Tmp']
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set workspace names (1)
  xfconf:
    channel: xfwm4
    property: /general/workspace_names
    value_type: string
    value: ['Main']
    force_array: true

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - The action to take upon the property/value.
    - The state V(get) has been removed in community.general 5.0.0. Please use the module
      M(community.general.xfconf_info) instead.
    type: str

value:
    description:
    - Preference properties typically have simple values such as strings, integers, or
      lists of strings and integers. See man xfconf-query(1).
    elements: raw
    type: list

channel:
    description:
    - A Xfconf preference channel is a top-level tree key, inside of the Xfconf repository
      that corresponds to the location for which all application properties/keys are stored.
      See man xfconf-query(1).
    required: true
    type: str

property:
    description:
    - A Xfce preference key is an element in the Xfconf repository that corresponds to
      an application preference. See man xfconf-query(1).
    required: true
    type: str

value_type:
    choices:
    - string
    - int
    - double
    - bool
    - uint
    - uchar
    - char
    - uint64
    - int64
    - float
    description:
    - The type of value being set.
    - When providing more than one O(value_type), the length of the list must be equal
      to the length of O(value).
    - If only one O(value_type) is provided, but O(value) contains more than on element,
      that O(value_type) will be applied to all elements of O(value).
    - If the O(property) being set is an array and it can possibly have only one element
      in the array, then O(force_array=true) must be used to ensure that C(xfconf-query)
      will interpret the value as an array rather than a scalar.
    - Support for V(uchar), V(char), V(uint64), and V(int64) has been added in community.general
      4.8.0.
    elements: str
    type: list

force_array:
    aliases:
    - array
    default: false
    description:
    - Force array even if only one element.
    type: bool
    version_added: 1.0.0
    version_added_collection: community.general

Outputs

channel:
  description: The channel specified in the module parameters
  returned: success
  sample: xsettings
  type: str
cmd:
  description:
  - A list with the resulting C(xfconf-query) command executed by the module.
  elements: str
  returned: success
  sample:
  - /usr/bin/xfconf-query
  - --channel
  - xfce4-panel
  - --property
  - /plugins/plugin-19/timezone
  - --create
  - --type
  - string
  - --set
  - Pacific/Auckland
  type: list
  version_added: 5.4.0
  version_added_collection: community.general
previous_value:
  description:
  - The value of the preference key before executing the module. Either a single string
    value or a list of strings for array types.
  - This is a string or a list of strings.
  returned: success
  sample: '"96" or ["red", "blue", "green"]'
  type: any
property:
  description: The property specified in the module parameters
  returned: success
  sample: /Xft/DPI
  type: str
value:
  description:
  - The value of the preference key after executing the module. Either a single string
    value or a list of strings for array types.
  - This is a string or a list of strings.
  returned: success
  sample: '"192" or ["orange", "yellow", "violet"]'
  type: any
value_type:
  description:
  - The type of the value that was changed (V(none) for O(state=reset)). Either a
    single string value or a list of strings for array types.
  - This is a string or a list of strings.
  returned: success
  sample: '"int" or ["str", "str", "str"]'
  type: any

See also