From c69733e750c7c459829437f6f76f461fa139ba3d Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sat, 18 Jun 2022 22:34:04 +0200 Subject: [PATCH] Add steps to install.sh --- install.sh | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 321b7d4..08d73d4 100755 --- a/install.sh +++ b/install.sh @@ -31,22 +31,44 @@ for pkg in "$@"; do echo " -> Stowing $pkg" # Symlink only the individual files instead of the entire directory - [ "$pkg" = "zsh" ] && mkdir -p "$HOME/.config/$pkg" - [ "$pkg" = "scripts" ] && mkdir -p "$HOME/.local/bin" + [ "$pkg" = "zsh" ] && ZSH=1 && mkdir -p "$HOME/.config/$pkg" + [ "$pkg" = "scripts" ] && DASH=1 && mkdir -p "$HOME/.local/bin" [ "$pkg" = "nvim" ] && NVIM=1 stow -t "$HOME" --ignore="README.md" "$pkg" done +if [ -n "$ZSH" ]; then + if ! grep -q "$(id -nu).*/zsh$" /etc/passwd; then + command -v zsh >/dev/null 2>&1 || sleep 0.5 \ + && echo "=> Installing Zsh" && $INSTALL zsh + + sleep 0.5 + chsh -s /bin/zsh + fi + + sleep 0.5 + echo "=> Initializing Zsh" + zsh -ic "fast-theme ~/.config/zsh/fast-theme.ini" +fi + if [ -n "$NVIM" ] && [ ! -f "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim ]; then + command -v nvim >/dev/null 2>&1 || sleep 0.5 \ + && echo "=> Installing Neovim" && $INSTALL nvim + sleep 0.5 echo "=> Installing vim-plug and plugins for Neovim" - - command -v nvim >/dev/null 2>&1 || $INSTALL nvim - curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ - https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/site/autoload/plug.vim" --create-dirs \ + "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" nvim --headless +PlugInstall +qa fi +if [ -n "$DASH" ] && ! command -v dash >/dev/null 2>&1; then + sleep 0.5 + echo "=> Installing Dash" + $INSTALL dash +fi + sleep 0.5 echo "=> Done!" +