---
- name: Set up env
  vars:
    variables:
      - key: CLUTTER_BACKEND
        value: wayland
      - key: QT_QPA_PLATFORM
        value: "wayland;xcb"
      - key: QT_QPA_PLATFORMTHEME
        value: qt5ct
      - key: SDL_VIDEODRIVER
        value: "wayland,x11"
      - key: TZ
        value: Europe/Stockholm
      - key: XDG_CURRENT_DESKTOP
        value: sway
      - key: XDG_DATA_DIRS
        value: /usr/local/share/:/usr/share/
      - key: _JAVA_AWT_WM_NONREPARENTING
        value: 1
      - key: MOZ_ENABLE_WAYLAND
        value: 1
      - key: SAL_USE_VCLPLUGIN
        value: gtk3
  hosts: localhost
  connection: local
  become: false
  tasks:
    - name: Set up environment variables
      become: true
      ansible.builtin.lineinfile:
        path: /etc/environment
        regex: ^{{ item.key }}=
        line: "{{ item.key }}={{ item.value }}"
      loop: "{{ variables }}"