- name: copy emacsd configuration
  ansible.builtin.copy:
    src: "{{ role_path }}/files/.emacs.d"
    dest: "/home/{{ laptop_user }}/"
    directory_mode: 0755
    force: false

# changes are made often enough right now that this
# should be copied every run.
- name: copy the shell profile over
  ansible.builtin.copy:
    src: "{{ role_path }}/files/.profile"
    dest: "/home/{{ laptop_user }}/.profile"
    mode: 0644
    force: true

- name: create binary directory
  ansible.builtin.file:
    path: "/home/{{ laptop_user }}/.local/bin"
    state: directory
    mode: 0755

- name: copy em
  ansible.builtin.copy:
    src: "{{ role_path }}/files/bin/em"
    dest: "/home/{{ laptop_user }}/.local/bin/em"
    mode: 0755

- name: copy various dotfiles
  ansible.builtin.copy:
    src: "{{ role_path }}/files/{{ item }}"
    dest: "/home/{{ laptop_user }}/{{ item }}"
    mode: 0644
  with_items:
    - .gitconfig
    - .gitignore_global
    - .hgrc
    - .mg
    - .vimrc

- name: copy vim directory
  ansible.builtin.copy:
    src: "{{ role_path }}/files/.vim"
    dest: "/home/{{ laptop_user }}/"
    directory_mode: 0755
    force: false

- name: copy various dotfiles for non-headless systems
  when: not headless
  ansible.builtin.copy:
    src: "{{ role_path }}/files/{{ item }}"
    dest: "/home/{{ laptop_user }}/{{ item }}"
    mode: 0644
  with_items:
    - .stumpwmrc
    - .XCompose
