1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_i3wm.git synced 2024-08-16 10:09:53 +02:00
ansible_role_i3wm/tasks/config.yml
2023-05-19 17:07:00 +02:00

72 lines
1.9 KiB
YAML

---
- name: Creates directory
become: true
ansible.builtin.file:
path: '/home/{{ i3wm_user }}/.config'
state: directory
mode: 0750
owner: "{{ i3wm_user }}"
group: "{{ i3wm_user }}"
- name: Create i3 config folder
become: true
ansible.builtin.file:
path: '/home/{{ i3wm_user }}/.config/i3/'
state: directory
mode: 0755
owner: "{{ i3wm_user }}"
group: "{{ i3wm_user }}"
- name: Copy multiple images
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: "{{ i3wm_user }}"
group: "{{ i3wm_user }}"
with_items:
- { src: 'files/background.png', dest: "/home/{{ i3wm_user }}/.config/background.png" }
- { src: 'files/lockscreen.png', dest: '/home/{{ i3wm_user }}/.config/lockscreen.png' }
when: i3wm_copy_wallpapers | bool
- name: Copy and validate i3wm config file
become: true
ansible.builtin.template:
src: templates/config.j2
dest: "/home/{{ i3wm_user }}/.config/i3/config"
mode: 0600
backup: true
validate: i3 -C -c %s
owner: "{{ i3wm_user }}"
group: "{{ i3wm_user }}"
# todo: rewrite user stuff and support multiple users
- name: Mkdir ~/.config/i3blocks/
become: true
ansible.builtin.file:
path: "/home/{{ i3wm_user }}/.config/i3blocks/"
state: directory
mode: '0755'
owner: "{{ i3wm_user }}"
group: "{{ i3wm_user }}"
- name: Copy i3blocks config
become: true
ansible.builtin.copy:
src: "files/i3blocks/config"
dest: "/home/{{ i3wm_user }}/.config/i3blocks/config"
mode: 0640
owner: "{{ i3wm_user }}"
group: "{{ i3wm_user }}"
- name: Copy i3blocks config
become: true
ansible.builtin.copy:
src: "files/i3blocks/{{ item }}"
dest: "/home/{{ i3wm_user }}/.config/i3blocks/{{ item }}"
mode: 0750
owner: "{{ i3wm_user }}"
group: "{{ i3wm_user }}"
with_items:
- 'volume'
- 'wlan'