---
- name: install necessary software
  become: yes
  apt:
    update_cache: yes
    pkg:
      - i3lock
      - dmenu
      - feh
      - dunst
      - arandr
      - fonts-font-awesome
  when: ansible_distribution == "Ubuntu"

- name: install necessary software
  become: yes
  community.general.pacman:
    name:
      - i3lock
      - dmenu
      - feh
      - dunst
      - arandr
      - ttf-font-awesome
      - xss-lock
  when: ansible_distribution == "Archlinux"

- name: override dmenu_run
  become: yes
  copy:
    src: usr/bin/dmenu_run
    dest: /usr/bin/dmenu_run
    mode: '0755'

- name: install necessary software
  when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "23.04"
  become: yes
  apt:
    update_cache: yes
    pkg:
      - libxapp1

- name: install necessary software
  when: ansible_distribution == "Ubuntu" and ansible_distribution_version != "23.04"
  become: yes
  apt:
    update_cache: yes
    pkg:
      - xapp