summaryrefslogtreecommitdiffstats
path: root/roles/hyprtheme/tasks/template-theme.yml
blob: 461ee503cad511ee1dbc70c6f11a78ff02d23bcf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
- name: "Load theme variables"
  ansible.builtin.include_vars: "vars/{{ hyprtheme_name }}.yml"

- name: "Set theme files fact"
  ansible.builtin.set_fact:
    hyprtheme_theme_files:
      - "alacritty.toml"
      - "btop.theme"
      - "hyprland.conf"
      - "hyprlock.conf"
      - "waybar.css"
      - "clipse.json"
      - "tofi.config"
      - "mako.ini"

- name: "Template theme files for: {{ hyprtheme_name }}"
  ansible.builtin.template:
    src: "theme/{{ file }}.j2"
    dest: "{{ ansible_facts['env']['HOME'] }}/.config/hyprtheme/themes/{{ hyprtheme_name }}/{{ file }}"
    mode: "0644"
  loop: "{{ hyprtheme_theme_files }}"
  loop_control:
    loop_var: file
  tags:
    # This is ignored because it is possible that some themes (ex. matte-black), would provide
    # a static override to some files (ex. btop.theme), which will result in
    # the template task overriding the static file (reporting changed), to be then overrided
    # again by the copy task, which will report changed again
    # This is safe to ignore for idempotence testing
    - molecule-idempotence-notest

- name: "Copy static theme files for: {{ hyprtheme_name }}"
  ansible.builtin.copy:
    src: "themes/{{ hyprtheme_name }}/"
    dest: "{{ ansible_facts['env']['HOME'] }}/.config/hyprtheme/themes/{{ hyprtheme_name }}/"
    mode: "0644"
  tags:
    # This is ignored because it is possible that some themes (ex. matte-black), would provide
    # a static override to some files (ex. btop.theme), which will result in
    # the template task overriding the static file (reporting changed), to be then overrided
    # again by the copy task, which will report changed again
    # This is safe to ignore for idempotence testing
    - molecule-idempotence-notest