summaryrefslogtreecommitdiffstats
path: root/roles/hyprtheme/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/hyprtheme/tasks')
-rw-r--r--roles/hyprtheme/tasks/main.yml40
-rw-r--r--roles/hyprtheme/tasks/template-theme.yml32
2 files changed, 72 insertions, 0 deletions
diff --git a/roles/hyprtheme/tasks/main.yml b/roles/hyprtheme/tasks/main.yml
new file mode 100644
index 00000000..a3762b98
--- /dev/null
+++ b/roles/hyprtheme/tasks/main.yml
@@ -0,0 +1,40 @@
+---
+- name: "Set themes fact"
+ ansible.builtin.set_fact:
+ hyprthemes:
+ - "catppuccin"
+ - "everforest"
+
+- name: "Create current theme directory"
+ ansible.builtin.file:
+ path: "{{ ansible_env.HOME }}/.config/hyprthemes/current"
+ state: "directory"
+ mode: "0755"
+
+- name: "Create themes directory"
+ ansible.builtin.file:
+ path: "{{ ansible_env.HOME }}/.config/hyprthemes/themes/{{ item }}"
+ state: "directory"
+ mode: "0755"
+ loop: "{{ hyprthemes }}"
+
+- name: "Create scripts directory"
+ ansible.builtin.file:
+ path: "{{ ansible_env.HOME }}/.config/hyprthemes/scripts"
+ state: "directory"
+ mode: "0755"
+
+- name: "Template themes"
+ ansible.builtin.include_tasks: "template-theme.yml"
+ vars:
+ theme_name: "{{ item }}"
+ loop: "{{ hyprthemes }}"
+
+- name: "Copy theme scripts"
+ ansible.builtin.copy:
+ src: "{{ item }}"
+ dest: "{{ ansible_env.HOME }}/.config/hyprthemes/{{ item }}"
+ mode: "0755"
+ loop:
+ - "scripts/theme-set"
+ - "scripts/theme-bg-next"
diff --git a/roles/hyprtheme/tasks/template-theme.yml b/roles/hyprtheme/tasks/template-theme.yml
new file mode 100644
index 00000000..bd94ce17
--- /dev/null
+++ b/roles/hyprtheme/tasks/template-theme.yml
@@ -0,0 +1,32 @@
+---
+- name: "Load theme variables"
+ ansible.builtin.include_vars: "vars/{{ theme_name }}.yml"
+
+- name: "Set theme files fact"
+ ansible.builtin.set_fact:
+ theme_files:
+ - "alacritty.toml"
+ - "btop.theme"
+ - "ghostty.conf"
+ - "hyprland.conf"
+ - "hyprlock.conf"
+ - "icons.theme"
+ - "kitty.conf"
+ - "swayosd.css"
+ - "walker.css"
+ - "waybar.css"
+
+- name: "Template theme files for: {{ theme_name }}"
+ ansible.builtin.template:
+ src: "theme/{{ file }}.j2"
+ dest: "{{ ansible_env.HOME }}/.config/hyprthemes/themes/{{ theme_name }}/{{ file }}"
+ mode: "0644"
+ loop: "{{ theme_files }}"
+ loop_control:
+ loop_var: file
+
+- name: "Copy static theme files for: {{ theme_name }}"
+ ansible.builtin.copy:
+ src: "themes/{{ theme_name }}/"
+ dest: "{{ ansible_env.HOME }}/.config/hyprthemes/themes/{{ theme_name }}/"
+ mode: "0644"