---
- name: Install Xorg
  pacman: name=xorg-server state=present

- name: Install Xinit
  pacman: name=xorg-xinit state=present

- name: Install xmodmap
  pacman: name=xorg-xmodmap state=present

- name: Install xdpyinfo
  pacman: name=xorg-xdpyinfo state=present

- name: Install xev
  pacman: name=xorg-xev state=present

- name: Install xorg-sessreg
  pacman: name=xorg-sessreg state=present

- name: Install xautomation
  pacman: name=xautomation state=present

- name: Install video driver(s)
  pacman:
    name: "{{ video_drivers }}"
    state: present

- name: Add user to video group
  user: name={{ user.name }} groups=video append=yes
  tags:
    - user

- name: Enable middle-click scrolling
  template: src=30-scroll.conf dest=/etc/X11/xorg.conf.d/30-scroll.conf
  when: libinput.middle_click_scroll is defined
  tags:
    - libinput

- name: Remap mouse buttons
  template: src=30-button_mapping.conf dest=/etc/X11/xorg.conf.d/30-button_mapping.conf
  when: libinput.button_mapping is defined
  tags:
    - libinput

- include: sxhkd.yml
- include: unclutter.yml
- include: autorandr.yml
- include: srandrd.yml
- include: termite.yml
- include: autocutsel.yml
- include: xdg.yml
