# ---------------------------------------------------------------------------- #
## \author Sebastien Beaugrand
## \sa http://beaugrand.chez.com/
## \copyright CeCILL 2.1 Free Software license
# ---------------------------------------------------------------------------- #
---
- name: copy homepage dir
  copy:
    src: homepage
    dest: "{{ home }}/.local/share/"

- name: stat chromium.desktop
  stat:
    path: "/usr/share/applications/chromium.desktop"
  register: st

- name: copy chromium.desktop
  copy:
    src: "/usr/share/applications/chromium.desktop"
    dest: "{{ home }}/.local/share/applications/"
    force: no
  when: st.stat.exists

- name: homepage
  lineinfile:
    path: "{{ home }}/.local/share/applications/chromium.desktop"
    regexp: '^Exec='
    line: >
      Exec=/usr/bin/chromium
      -homepage {{ home }}/.local/share/homepage/homepage.html %U
  when: st.stat.exists

- name: cppreference offline
  unarchive:
    src: https://github.com/PeterFeicht/cppreference-doc/releases/download/v20250209/html-book-20250209.tar.xz
    dest: /usr/share/doc/
    remote_src: yes
  become: yes