blob: 7686df0d65def489f24b48d9e792f0076a4d05a7 (
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
45
46
47
48
49
50
51
52
53
54
55
56
|
---
- name: "Set themes fact"
ansible.builtin.set_fact:
hyprtheme_themes:
- "catppuccin"
- "everforest"
- "gruvbox"
- "matte-black"
- "osaka-jade"
- "ristretto"
- "tokyo-night"
- name: "Create current theme directory"
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.config/hyprtheme/current"
state: "directory"
mode: "0755"
- name: "Create themes directory"
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.config/hyprtheme/themes/{{ item }}"
state: "directory"
mode: "0755"
loop: "{{ hyprtheme_themes }}"
- name: "Create scripts directory"
ansible.builtin.file:
path: "{{ ansible_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_env.HOME }}/.config/hyprtheme/{{ item }}"
mode: "0755"
loop:
- "scripts/theme-set"
- "scripts/theme-bg-next"
- 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_env.HOME }}/.config/hyprtheme/scripts/theme-set {{ hyprtheme_default_theme }}"
creates: "{{ ansible_env.HOME }}/.config/hyprtheme/current/hyprland.conf"
failed_when: false
|