From 030ba6553db11be4031ed5e3dfa20e4ad7e322e2 Mon Sep 17 00:00:00 2001 From: Joty Date: Sat, 14 Apr 2018 00:08:57 +0930 Subject: [PATCH] init --- .zshrc | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 1 + quickz-sh.sh | 75 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+) create mode 100644 .zshrc create mode 100644 README.md create mode 100755 quickz-sh.sh diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..93cfba9 --- /dev/null +++ b/.zshrc @@ -0,0 +1,92 @@ +export TERM="xterm-256color" +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Path to your oh-my-zsh installation. + export ZSH=$HOME/.oh-my-zsh + +# Set name of the theme to load. Optionally, if you set this to "random" +# it'll load a random theme each time that oh-my-zsh is loaded. +# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes +ZSH_THEME="powerlevel9k/powerlevel9k" + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. Case +# sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +# DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git zsh-completions zsh-autosuggestions zsh-syntax-highlighting history-substring-search) +#plugins+=(zsh-nvm) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='mvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# ssh +# export SSH_KEY_PATH="~/.ssh/rsa_id" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +#[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..be77fcf --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# quickz-sh diff --git a/quickz-sh.sh b/quickz-sh.sh new file mode 100755 index 0000000..457c479 --- /dev/null +++ b/quickz-sh.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +if command -v zsh &> /dev/null && command -v git &> /dev/null ; then + echo "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" + else + echo "\nCan'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 +fi + + +mv ~/.zshrc ~/.zshrc-backup && cp .zshrc ~/ + + +if git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions; then : +else + cd ~/.oh-my-zsh/plugins/zsh-autosuggestions && git pull +fi + + +if git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting; then : +else + cd ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting && git pull +fi + +if git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions; then : +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 + cd ~/.oh-my-zsh/custom/plugins/zsh-history-substring-search && git pull +fi + + +if git clone https://github.com/powerline/fonts.git --depth=1 ~/powerline_fonts; then : +else + cd ~/powerline_fonts && git pull +fi + +if ~/powerline_fonts/install.sh && rm -rf ~/powerline_fonts; then + echo "powerline_fonts Installed" +else + echo "\n\npowerline_fonts Installation Failed\n\n" +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" +else + echo "Something is wrong" + +exit