diff --git a/.zshrc b/.zshrc index 93cfba9..942beec 100644 --- a/.zshrc +++ b/.zshrc @@ -86,7 +86,4 @@ source $ZSH/oh-my-zsh.sh # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" -#[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh - - - +alias wip="wget -qO- https://wtfismyip.com/text" # quickly show external ip address diff --git a/README.md b/README.md index be77fcf..0566cd1 100644 --- a/README.md +++ b/README.md @@ -1 +1,10 @@ # quickz-sh + +Quickly install and setup oh-my-zsh with powerlevel9k, zsh-completions, zsh-autosuggestions, zsh-syntax-highlighting, history-substring-search etc. + +## Installation +``` bash +git clone https://github.com/jotyGill/quickz-sh.git +cd quickz-sh +./quickz-sh.sh +``` diff --git a/quickz-sh.sh b/quickz-sh.sh index 457c479..c5b3c91 100755 --- a/quickz-sh.sh +++ b/quickz-sh.sh @@ -1,33 +1,40 @@ #!/bin/bash if command -v zsh &> /dev/null && command -v git &> /dev/null ; then - echo "ZSH and Git are already installed\n" + echo -e "ZSH and Git are already installed\n" else if sudo apt install -y zsh git || sudo dnf install -y zsh git || sudo yum install -y zsh git || brew install git zsh ; then - echo "\nZSH and Git Installed\n" + echo -e "ZSH and Git Installed\n" else - echo "\nCan't install ZSH or Git \n" && exit + echo -e "Can't install ZSH or Git\n" && exit fi fi - #if [ -d ~/.oh-my-zsh ]; then # printf "You already have Oh My Zsh installed.\n" # printf "Moving that to .oh-my-zsh-backup\n" # mv ~/.oh-my-zsh ~/.oh-my-zsh-backup #fi -echo "\nInstalling oh-my-zsh\n" -if sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"; then - echo "Installed OH-MY-ZSH/n" -else - echo "Installation of OH-MY-ZSH Failed" - exit +if mv ~/.zshrc ~/.zshrc-backup; then # if already have zshrc-backup, keep it, don't overwrite + echo -e "\nBacked up the current .zshrc to .zshrc-backup\n" fi +echo -e "\nInstalling oh-my-zsh\n" +if git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh; then + echo -e "Installed OH-MY-ZSH\n" +fi -mv ~/.zshrc ~/.zshrc-backup && cp .zshrc ~/ +cp -f .zshrc ~/ + + +#if sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"; then +# echo "Installed OH-MY-ZSH\n" +#else +# echo "Installation of OH-MY-ZSH Failed" +# exit +#fi if git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions; then : @@ -42,12 +49,12 @@ else fi if git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions; then : -else +else cd ~/.oh-my-zsh/custom/plugins/zsh-completions && git pull fi if git clone https://github.com/zsh-users/zsh-history-substring-search ~/.oh-my-zsh/custom/plugins/zsh-history-substring-search; then : -else +else cd ~/.oh-my-zsh/custom/plugins/zsh-history-substring-search && git pull fi @@ -58,18 +65,24 @@ else fi if ~/powerline_fonts/install.sh && rm -rf ~/powerline_fonts; then - echo "powerline_fonts Installed" -else - echo "\n\npowerline_fonts Installation Failed\n\n" + echo -e "powerline_fonts Installed\n" +else + echo -e "powerline_fonts Installation Failed\n" +fi + +if git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k; then : +else + cd ~/.oh-my-zsh/custom/themes/powerlevel9k && git pull fi #rsync -ra .zshrc ~/ && rsync -ra .oh-my-zsh ~/ && rsync -ra .fz* ~/ # source ~/.zshrc -if chsh -s $(which zsh) && /bin/zsh -i -c upgrade_oh_my_zsh; then - echo "Installation Successful, exit terminal and enter a new session" +#if chsh -s $(which zsh) && /bin/zsh -i -c upgrade_oh_my_zsh; then +if /bin/zsh -i -c upgrade_oh_my_zsh; then + echo -e "\nInstallation Successful, exit terminal and enter a new session" else - echo "Something is wrong" - + echo -e "\nSomething is wrong" +fi exit