#!/bin/bash echo "***** INSTALL SHELL *****" if [ -x "/usr/local/bin/fish" ]; then SHELL_PATH="/usr/local/bin/fish" elif [ -x "/opt/homebrew/bin/fish" ]; then SHELL_PATH="/opt/homebrew/bin/fish" elif [ -x "$HOME/.nix-profile/bin/fish" ]; then SHELL_PATH="$HOME/.nix-profile/bin/fish" else echo "Cannot set login shell! Tried the following paths:" echo " - /usr/local/bin/fish" echo " - /opt/homebrew/bin/fish" echo " - $HOME/.nix-profile/bin/fish" exit 1 fi if [ "$SHELL" = "$SHELL_PATH" ]; then echo "$SHELL_PATH is already the login shell." else echo "Setting the login shell to $SHELL_PATH ..." grep -q "$SHELL_PATH" /etc/shells || echo "$SHELL_PATH" | sudo tee -a /etc/shells sudo chsh -s "$SHELL_PATH" $(whoami) fi echo