From cca53ad11db666fc6a8b5a718f199168da8dc887 Mon Sep 17 00:00:00 2001 From: Ivan Golikov Date: Sun, 15 Dec 2024 22:48:03 +0100 Subject: [PATCH] Setting fish as the default user shell --- .local/share/dotfiles/install_dev_tools.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.local/share/dotfiles/install_dev_tools.yml b/.local/share/dotfiles/install_dev_tools.yml index ece9533..5148a4b 100644 --- a/.local/share/dotfiles/install_dev_tools.yml +++ b/.local/share/dotfiles/install_dev_tools.yml @@ -18,6 +18,9 @@ pacman_packages: - python-pipx + macos_fish_path: /usr/local/bin/fish + arch_fish_path: /usr/bin/fish + tasks: - name: Check the current OS family ansible.builtin.set_fact: @@ -46,3 +49,15 @@ state: present become: true when: is_arch + + - name: Set fish as default shell + become: true + ansible.builtin.user: + name: "{{ ansible_env.USER }}" + shell: "{{ shell_path }}" + vars: + shell_path: "\ + {% if is_macos %}{{ macos_fish_path }}\ + {% elif is_arch %}{{ arch_fish_path }}\ + {% else %}/bin/fish\ + {% endif %}"