Skip to content

Commit

Permalink
shell/zsh: add instruction when chsh fail
Browse files Browse the repository at this point in the history
  • Loading branch information
ztlevi committed Jul 30, 2024
1 parent 0d5fc1e commit dc0c3af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shell/zsh/_init
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env zsh
source ${0:A:h}/../../deploy
source $DOTTY_CONFIG_HOME/shell/zsh/.zshenv
source $DOTTY_CONFIG_HOME/env

install() {
# Base utilities
Expand Down Expand Up @@ -47,8 +48,7 @@ EOF
esac

# Set default shell to zsh
chsh -s $(which zsh) $(whoami)
# if the command above doesn't work, edit /etc/passwd directly to change the login shell
chsh -s $(which zsh) $(whoami) || echo-fail "Change shell to zsh failed. Edit /etc/passwd directly to change the login shell."

local zsh="$(which zsh)"
grep $zsh /etc/shells &>/dev/null || sudo tee -a /etc/shells <<<$zsh
Expand Down

0 comments on commit dc0c3af

Please sign in to comment.