From b75bfee9847fe0123f2c2dab0395d7cc12ded6f0 Mon Sep 17 00:00:00 2001 From: ray Date: Thu, 19 Mar 2020 19:47:25 +0000 Subject: [PATCH] set zsh as interactive shell --- config/zsh.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 config/zsh.sh diff --git a/config/zsh.sh b/config/zsh.sh new file mode 100755 index 0000000..5eadf7b --- /dev/null +++ b/config/zsh.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +set -e + +if command -v apt-get ; then + apt-get -y install zsh git +else + echo "Error - no package installer found." + exit 1 +fi + +# clone configuration +mkdir -p /home/"$_user"/.config +cd /home/"$_user" +rm -Rf .config/zsh +if [ -h .zshrc ] ; then + rm .zshrc +elif [ -f .zshrc ] ; then + mv .zshrc .zshrc.backup +fi +su ray -c 'git clone https://git.rayelliott.dev/dots/zsh.git .config/zsh' +su ray -c 'git clone https://github.com/tarjoilija/zgen.git .config/zsh/zgen' +su ray -c 'ln -s .config/zsh/zshrc .zshrc' + +# set interactive shell +_zsh=$(command -v zsh) +if [ -f "$_zsh" ] ; then + chsh ray -s "$_zsh" +fi