---
- name: Create config directories
  file:
    path: '~/.config/waybar/{{ item }}'
    state: directory
    mode: 0755
  loop:
    - modules
    - sway
    - river

- name: Copy module scripts
  copy:
    src: '{{ item }}'
    dest: ~/.config/waybar/modules/
    force: yes
    mode: 0644
  loop:
    - media.sh
    - tempamd.sh
    - tempintel.sh
    - weather.sh
    - wttr.sh

- name: Copy config for sway
  template:
    src: config_sway.j2
    dest: ~/.config/waybar/sway/config
    force: yes
    mode: 0644

- name: Copy style for sway
  template:
    src: style_sway.j2
    dest: ~/.config/waybar/sway/style.css
    force: yes
    mode: 0644
