---
- name: waybar | Create config directories
  file:
    path: '{{ xdg_dir.config_home }}/waybar/{{ item }}'
    state: directory
    mode: '755'
  loop:
    - modules
    - sway
    - river

- name: waybar | Copy module scripts
  copy:
    src: waybar/{{ item }}
    dest: '{{ xdg_dir.config_home }}/waybar/modules/'
    mode: '644'
  loop:
    - media.sh
    - tempamd.sh
    - tempintel.sh
    - weather.sh
    - wttr.sh

- name: waybar | Copy config for each Wayland compositor
  template:
    src: waybar/config_{{ item }}.j2
    dest: '{{ xdg_dir.config_home }}/waybar/{{ item }}/config'
    mode: '644'
  loop:
    - sway
    # - river

- name: waybar | Copy style for each Wayland compositor
  template:
    src: waybar/style_{{ item }}.j2
    dest: '{{ xdg_dir.config_home }}/waybar/{{ item }}/style.css'
    mode: '644'
  loop:
    - sway
    # - river
