- name: 终端环境 fish
  become: true
  user:
    name: '{{ansible_user_id}}'
    shell: /usr/bin/fish
  when: ansible_user_id == "root" or not manual_fish_mode is defined
- name: 终端环境 fish omf
  shell: curl -L http://get.oh-my.fish | fish
  environment:
    NONINTERACTIVE: true
    ASSUME_YES: true
  when: not china_mirror_omf
  args:
    creates: '~/.local/share/omf'
- name: 终端环境 fish omf China
  shell: curl -L https://cdn01.moecube.com/init/install_fish | fish
  environment:
    NONINTERACTIVE: true
    ASSUME_YES: true
    OMF_REPO_URI: https://code.mycard.moe/nanahira/oh-my-fish
  when: china_mirror_omf
  args:
    creates: '~/.local/share/omf'
- name: 终端环境 fish robbyrussell
  shell: omf install robbyrussell
  args:
    executable: /usr/bin/fish
    creates: '~/.local/share/omf/themes/robbyrussell'
- name: 终端环境 fish 自动填充
  file:
    name: '~/.config/fish/completions'
    state: directory
- name: 终端环境 fish 自动填充 docker
  copy:
    src: /usr/share/fish/vendor_completions.d/docker.fish
    dest: '~/.config/fish/completions/docker.fish'
    remote_src: yes
  when: install_docker and ansible_distribution != 'Fedora'
