- name: Install void customizations
  hosts: void
  become: true
  vars:
    ansible_chroot_exe: arch-chroot
  tasks:
    - name: Set up keyd for custom key events
      community.general.xbps:
        name:
          - keyd
        state: present
      notify: installed-keyd

    - name: Install river wm
      community.general.xbps:
        name:
          - river
          - waybar
        state: present

    - name: Install many fonts
      community.general.xbps:
        name:
          - nerd-fonts-otf
          - noto-fonts-ttf
          - noto-fonts-cjk
        state: present
      notify: installed-fonts

    # - name: Install base custom stuff
    #   community.general.xbps:
    #     name:
    #       - zsh
    #     state: present
    #   notify: installed-fonts

  handlers:
    - name: Activate keyd service
      ansible.builtin.file:
        force: 'yes'
        src: "/etc/sv/{{ item }}"
        dest: "/etc/runit/runsvdir/default/{{ item }}"
        state: link
      with_items: [ keyd ]
      listen: installed-keyd

    - name: Regenerate fontconfig
      ansible.builtin.command:
        argv:
          - xbps-reconfigure
          - --force
          - fontconfig
      listen: installed-fonts