1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_sway.git synced 2024-08-16 13:49:49 +02:00
ansible_role_sway/tasks/config.yml

92 lines
2.4 KiB
YAML
Raw Normal View History

2021-11-08 12:28:11 +01:00
---
- name: Creates directory
become: true
ansible.builtin.file:
path: '{{ i3wm_usr.home }}/.config'
2021-11-08 12:28:11 +01:00
state: directory
mode: 0750
owner: "{{ i3wm_usr.user }}"
group: "{{ i3wm_usr.user }}"
2021-11-08 12:28:11 +01:00
2023-05-19 17:07:00 +02:00
- name: Create i3 config folder
2021-11-08 12:28:11 +01:00
become: true
ansible.builtin.file:
path: '{{ i3wm_usr.home }}/.config/i3/'
2021-11-08 12:28:11 +01:00
state: directory
mode: 0750
owner: "{{ i3wm_usr.user }}"
group: "{{ i3wm_usr.user }}"
2021-11-08 12:28:11 +01:00
2023-05-19 17:07:00 +02:00
- name: Copy multiple images
become: true
2021-11-08 12:28:11 +01:00
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: "{{ i3wm_usr.user }}"
group: "{{ i3wm_usr.user }}"
loop:
- { src: 'files/background.png', dest: "{{ i3wm_usr.home }}/.config/background.png" }
- { src: 'files/lockscreen.png', dest: '{{ i3wm_usr.home }}/.config/lockscreen.png' }
2021-11-08 12:28:11 +01:00
when: i3wm_copy_wallpapers | bool
2023-05-19 17:07:00 +02:00
- name: Copy and validate i3wm config file
2021-11-08 12:28:11 +01:00
become: true
2021-11-08 13:55:47 +01:00
ansible.builtin.template:
2021-11-08 12:28:11 +01:00
src: templates/config.j2
dest: "{{ i3wm_usr.home }}/.config/i3/config"
2021-11-08 12:28:11 +01:00
mode: 0600
backup: true
validate: i3 -C -c %s
owner: "{{ i3wm_usr.user }}"
group: "{{ i3wm_usr.user }}"
2021-11-08 12:28:11 +01:00
- name: Create directory ~/.config/i3blocks/
2021-11-15 00:28:35 +01:00
become: true
2021-11-08 19:30:22 +01:00
ansible.builtin.file:
path: "{{ i3wm_usr.home }}/.config/i3blocks/"
2021-11-08 19:30:22 +01:00
state: directory
mode: '0750'
owner: "{{ i3wm_usr.user }}"
group: "{{ i3wm_usr.user }}"
2021-11-08 19:30:22 +01:00
- name: Generate i3blocks config
2021-11-08 12:28:11 +01:00
become: true
ansible.builtin.template:
src: 'templates/i3blocks_config.j2'
dest: "{{ i3wm_usr.home }}/.config/i3blocks/config"
2021-11-08 19:30:22 +01:00
mode: 0640
owner: "{{ i3wm_usr.user }}"
group: "{{ i3wm_usr.user }}"
2021-11-08 19:30:22 +01:00
2023-05-19 17:07:00 +02:00
- name: Copy i3blocks config
2021-11-08 19:30:22 +01:00
become: true
ansible.builtin.copy:
src: "files/i3blocks/{{ item }}"
dest: "{{ i3wm_usr.home }}/.config/i3blocks/{{ item }}"
2021-11-08 19:30:22 +01:00
mode: 0750
owner: "{{ i3wm_usr.user }}"
group: "{{ i3wm_usr.user }}"
loop:
- 'volume.sh'
2023-08-22 14:53:13 +02:00
- 'wlan.py'
- 'battery.py'
- name: Create rofi config folder
become: true
ansible.builtin.file:
path: '{{ i3wm_usr.home }}/.config/rofi/'
state: directory
mode: 0750
owner: "{{ i3wm_usr.user }}"
group: "{{ i3wm_usr.user }}"
- name: Copy rofi config
become: true
ansible.builtin.copy:
src: "{{ i3_rofi_config_file }}"
dest: "{{ i3wm_usr.home }}/.config/rofi/config.rasi"
mode: 0640
owner: "{{ i3wm_usr.user }}"
group: "{{ i3wm_usr.user }}"