--- - name: "Create current theme directory" ansible.builtin.file: path: "{{ ansible_facts['env']['HOME'] }}/.config/hyprtheme/current" state: "directory" mode: "0755" - name: "Create themes directory" ansible.builtin.file: path: "{{ ansible_facts['env']['HOME'] }}/.config/hyprtheme/themes/{{ item }}" state: "directory" mode: "0755" loop: "{{ hyprtheme_themes }}" - name: "Create scripts directory" ansible.builtin.file: path: "{{ ansible_facts['env']['HOME'] }}/.config/hyprtheme/scripts" state: "directory" mode: "0755" - name: "Template themes" ansible.builtin.include_tasks: "template-theme.yml" vars: hyprtheme_name: "{{ item }}" loop: "{{ hyprtheme_themes }}" - name: "Copy theme scripts" ansible.builtin.copy: src: "{{ item }}" dest: "{{ ansible_facts['env']['HOME'] }}/.config/hyprtheme/{{ item }}" mode: "0755" loop: - "scripts/theme.sh" - "scripts/wallpaper.sh" - name: "Set default theme" ansible.builtin.command: # Running the command creates the symlinks for the current themes, using the hyprland.conf file to avoid rerunning # This will run only if there is no current theme in place # This will ignore the errors in the script, because the script restarts some hyprland services, which # will fail on ssh connection, but having the theme files placed in the right directory will make sure that # the first setup of hyprtheme is working and doesn't show errors on first boot cmd: "{{ ansible_facts['env']['HOME'] }}/.config/hyprtheme/scripts/theme.sh {{ hyprtheme_default_theme }}" creates: "{{ ansible_facts['env']['HOME'] }}/.config/hyprtheme/current/hyprland.conf" failed_when: false