---
- name: Download some wallpapers
  hosts: all
  vars:
    - wallpaper_dir: ~/Pictures/Wallpapers
  tasks:
    - name: Create wallpaper directory if missing
      file:
        path: '{{ wallpaper_dir }}'
        state: directory

    - name: An artwork by @ogipote
      get_url:
        url: https://ogipote.com/wp-content/uploads/2021/03/%E3%83%AC%E3%82%A4%E3%83%A4%E3%83%BC5.jpg
        dest: '{{ wallpaper_dir }}/レイヤー5.jpg'
        mode: 0644

    - name: Key artwork of Sayoasa anime
      get_url:
        url: http://sayoasa.jp/en/img/top/key.jpg
        dest: '{{ wallpaper_dir }}/key.jpg'
        mode: 0644

    # tumblr has good enough image quality
    - name: Maquia artwork by @necomi
      get_url:
        url: https://64.media.tumblr.com/269736b9e0af3be25460f469fa2c06f4/tumblr_p6b2chhj2g1v84cqao1_1280.png
        dest: '{{ wallpaper_dir }}/maquia.png'
        mode: 0644
      tags: never

    # Rimuu has her site rewritten. The artworks are now in crappy webp format
    # generated by wix.com so let's upload 1 to Github and call it a day
    - name: Barbara artwork by @rimuu
      get_url:
        url: https://github.com/FollieHiyuki/FollieHiyuki/raw/main/wallpapers/90575757_p0.png
        dest: '{{ wallpaper_dir }}/90575757_p0.png'
        mode: 0644

    - name: Short Fubuki animation by @kaynimatic
      command:
        cmd: ~/.local/bin/gallery-dl https://twitter.com/i/status/1324684931885273088
        creates: ~/Pictures/gallery-dl/twitter/kaynimatic/1324684931885273088_1.mp4
      tags: never
