---
- name: install interception tools
  community.general.pacman:
    name:
      - interception-tools
      - interception-caps2esc
      - interception-dual-function-keys

- name: make config directories
  become: true
  ansible.builtin.file:
    path: /etc/interception/dual-function-keys
    state: directory
    mode: '0755'

- name: copy udevmon config files
  become: true
  ansible.builtin.copy:
    src: udevmon.yaml
    dest: /etc/interception/udevmon.yaml
    owner: root
    group: root
    mode: '0644'

- name: copy dual-function-key config files
  become: true
  ansible.builtin.copy:
    src: dual-function-keys.yaml
    dest: /etc/interception/dual-function-keys/default-mapping.yaml
    owner: root
    group: root
    mode: '0644'

- name: enable udevmon service
  become: true
  ansible.builtin.systemd:
    daemon_reload: true
    name: udevmon
    enabled: true
