---
- block:
    - name: wofi | Create config directory
      file:
        path: ~/.config/wofi
        state: directory
        mode: 0755

    - name: wofi | Copy config
      template:
        src: wofi.j2
        dest: ~/.config/wofi/config
        force: yes
        mode: 0644

    - name: wofi | Copy style
      template:
        src: wofi-style.j2
        dest: ~/.config/wofi/style.css
        force: yes
        mode: 0644

    - name: wofi | Install wofi-calc script
      copy:
        src: wofi-calc
        dest: ~/.local/libexec/wayland/wofi-calc
        force: yes
        mode: 0755
  when: launcher == 'wofi'

- block:
    - name: rofi | Create config directory
      file:
        path: ~/.config/rofi/themes
        state: directory
        mode: 0755

    - name: rofi | Copy config
      template:
        src: rofi.j2
        dest: ~/.config/rofi/config.rasi
        force: yes
        mode: 0644

    - name: rofi | Copy file-browser-extended plugin config
      copy:
        src: file-browser
        dest: ~/.config/rofi/file-browser
        force: yes
        mode: 0644

    - name: rofi | Copy theme
      template:
        src: rofi-theme.j2
        dest: '~/.config/rofi/themes/{{ theme }}.rasi'
        force: yes
        mode: 0644
  when: launcher == 'rofi'
