Commit 67bb10069cb6494d5055cb8e99d923cee383e51b

Authored by mj
Exists in master and in 2 other branches 02-merge, dev

Showing 79 changed files Inline Diff

1 #@IgnoreInspection AddShebang 1 #@IgnoreInspection AddShebang
2 # 2 #
3 # ** Initiate with: ** 3 # ** Initiate with: **
4 # cd && curl -L http://git.str8.biz/mj/zsh-config/raw/master/tools/install.sh | sh 4 # cd && curl -L http://git.str8.biz/mj/zsh-config/raw/master/tools/install.sh | sh
5 # 5 #
6 # --------------------------------------------------------------------------------------------- 6 # ---------------------------------------------------------------------------------------------
7 # 7 #
8 # gj@ubuntu4docker:~$ touch install.sh 8 # gj@ubuntu4docker:~$ touch install.sh
9 # gj@ubuntu4docker:~$ rm install.sh && nano install.sh && chmod +x install.sh && ./install.sh 9 # gj@ubuntu4docker:~$ rm install.sh && nano install.sh && chmod +x install.sh && ./install.sh
10 # 10 #
11 ################################################################################################ 11 ################################################################################################
12 12
13 set -e 13 set -e
14 14
15 if [ -d /proc/vz ] && [ ! -d /proc/vz/beancounter ] && [ ! $DONTINSTALL ]; then 15 if [ -d /proc/vz ] && [ ! -d /proc/vz/beancounter ] && [ ! $DONTINSTALL ]; then
16 apt-get -yq install curl dialog git nano screen zsh 16 apt-get -yq install curl dialog git nano screen zsh
17 else 17 else
18 if [ "$UID" != "0" ]; then CMD_PREFIX="sudo"; else CMD_PREFIX=""; fi 18 if [ "$UID" != "0" ]; then CMD_PREFIX="sudo"; else CMD_PREFIX=""; fi
19 19
20 if [ "$SHELL" != "$(which zsh)" ]; then 20 if [ "$SHELL" != "$(which zsh)" ]; then
21 echo "$(which zsh)" 21 echo "$(which zsh)"
22 $CMD_PREFIX echo "enter pass...." 22 $CMD_PREFIX echo "enter pass...."
23 23
24 echo "ok" 24 echo "ok"
25 25
26 $CMD_PREFIX apt-get -yq install curl dialog git nano zsh 26 $CMD_PREFIX apt-get -yq install curl dialog git nano zsh
27 fi 27 fi
28 fi 28 fi
29 29
30 if [ ! -n "$HOME" ]; then 30 if [ ! -n "$HOME" ]; then
31 HOME=~/ 31 HOME=~/
32 fi 32 fi
33 33
34 if [ ! -n "$ZCNF" ]; then 34 if [ ! -n "$ZCNF" ]; then
35 ZCNF=$HOME/.config/zsh-config 35 ZCNF=$HOME/.config/zsh-config
36 fi
36 fi 37
37 38 if [ ! -n "$ZSH" ]; then
38 if [ ! -n "$ZSH" ]; then 39 ZSH=$ZCNF/packages/oh-my-zsh
40 fi
39 ZSH=$ZCNF/packages/oh-my-zsh 41
40 fi 42 echo "\033[0;34mCleaning...\033[0m"
41 43 if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then
42 echo "\033[0;34mCleaning...\033[0m" 44 rm -rf ~/.config/zsh-config
43 if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then 45 fi
44 rm -rf ~/.config/zsh-config 46
45 fi 47 if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then
46 48 rm -rf ~/.config/oh-my-zsh
47 if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then 49 fi
48 rm -rf ~/.config/oh-my-zsh 50
49 fi 51 if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then
50 52 rm -rf ~/.config/antigen
51 if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then 53 fi
52 rm -rf ~/.config/antigen 54
53 fi 55 if [ -d ~/.oh-my-zsh ] || [ -h ~/.oh-my-zsh ]; then
54 56 rm -rf ~/.oh-my-zsh
55 if [ -d ~/.oh-my-zsh ] || [ -h ~/.oh-my-zsh ]; then 57 fi
56 rm -rf ~/.oh-my-zsh 58
57 fi 59 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
58 60 mv ~/.zshrc ~/.zshrc.pre-zsh-cnf
59 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then 61 fi
60 mv ~/.zshrc ~/.zshrc.pre-zsh-cnf 62
61 fi 63 #
62 64 # BASH:
63 # 65 #
64 # BASH: 66 if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then
65 # 67 mv ~/.bashrc ~/.bashrc.pre-zsh-cnf
66 if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then 68 fi
67 mv ~/.bashrc ~/.bashrc.pre-zsh-cnf 69 if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then
68 fi 70 rm ~/.bash_aliases
69 if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then 71 fi
70 rm ~/.bash_aliases 72
71 fi 73 echo "\033[0;34mCloning Zsh Config...\033[0m"
72 74 hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || {
73 echo "\033[0;34mCloning Zsh Config...\033[0m" 75 echo "can't clone repo.."
74 hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { 76 exit 1
75 echo "can't clone repo.." 77 }
76 exit 1 78
77 } 79 echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m"
78 80 cp $ZCNF/templates/zshrc.sh ~/.zshrc
79 echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" 81 cp $ZCNF/templates/bashrc.sh ~/.bashrc
80 cp $ZCNF/templates/zshrc.sh ~/.zshrc 82
81 cp $ZCNF/templates/bashrc.sh ~/.bashrc 83 #sed -i -e "/^export ZSH=/ c\\
82 84 #export ZSH=$ZSH
83 #sed -i -e "/^export ZSH=/ c\\ 85 #" ~/.zshrc
84 #export ZSH=$ZSH 86
85 #" ~/.zshrc 87 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
86 88 sed -i -e "/export PATH=/ c\\
87 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" 89 export PATH=\"$PATH\"
88 sed -i -e "/export PATH=/ c\\ 90 " ~/.zshrc
89 export PATH=\"$PATH\" 91
90 " ~/.zshrc 92 if [ "$SHELL" != "$(which zsh)" ]; then
91 93 echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
92 if [ "$SHELL" != "$(which zsh)" ]; then 94 # echo "chsh -s $(which zsh)"
93 echo "\033[0;34mTime to change your default shell to zsh!\033[0m" 95 echo "chsh -s /bin/zsh"
94 # echo "chsh -s $(which zsh)" 96 fi
95 echo "chsh -s /bin/zsh" 97
96 fi 98 echo "\033[0;32m"' __ __ '"\033[0m"
97 99 echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m"
98 echo "\033[0;32m"' __ __ '"\033[0m" 100 echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m"
99 echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" 101 echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m"
100 echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" 102 echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m"
101 echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" 103 echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m"
102 echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" 104 echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m"
103 echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" 105 echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m"
104 echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" 106 echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m"
105 echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" 107 #env zsh
106 echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" 108 #. ~/.zshrc
107 #env zsh 109