Commit d911c61de0c80ff66ef3ace6baf8e3cfcc59edac
Exists in
master
and in
2 other branches
Merge branch 'master' of git.str8.biz:mj/zsh-config into 01-pull
Showing 4 changed files Inline Diff
templates/bashrc.sh
1 | #@IgnoreInspection AddShebang | 1 | #@IgnoreInspection AddShebang |
2 | # If not running interactively, don't do anything | 2 | # If not running interactively, don't do anything |
3 | case $- in | 3 | case $- in |
4 | *i*) ;; | 4 | *i*) ;; |
5 | *) return;; | 5 | *) return;; |
6 | esac | 6 | esac |
7 | 7 | ||
8 | ######################## | 8 | ######################## |
9 | # ******************** # | 9 | # ******************** # |
10 | # * * # | 10 | # * * # |
11 | # * COMPLETION * # | 11 | # * COMPLETION * # |
12 | # * * # | 12 | # * * # |
13 | # ******************** # | 13 | # ******************** # |
14 | ######################## | 14 | ######################## |
15 | 15 | ||
16 | # enable bash completion in interactive shells | 16 | # enable bash completion in interactive shells |
17 | if [ -f /etc/bash_completion ]; then | 17 | if [ -f /etc/bash_completion ]; then |
18 | . /etc/bash_completion | 18 | . /etc/bash_completion |
19 | fi | 19 | fi |
20 | 20 | ||
21 | # if the command-not-found package is installed, use it | 21 | # if the command-not-found package is installed, use it |
22 | if [ -x /usr/lib/command-not-found ]; then | 22 | if [ -x /usr/lib/command-not-found ]; then |
23 | function command_not_found_handle { | 23 | function command_not_found_handle { |
24 | # check because c-n-f could've been removed in the meantime | 24 | # check because c-n-f could've been removed in the meantime |
25 | if [ -x /usr/lib/command-not-found ]; then | 25 | if [ -x /usr/lib/command-not-found ]; then |
26 | /usr/bin/python /usr/lib/command-not-found -- $1 | 26 | /usr/bin/python /usr/lib/command-not-found -- $1 |
27 | return $? | 27 | return $? |
28 | else | 28 | else |
29 | return 127 | 29 | return 127 |
30 | fi | 30 | fi |
31 | } | 31 | } |
32 | fi | 32 | fi |
33 | 33 | ||
34 | ######################## | 34 | ######################## |
35 | # ******************** # | 35 | # ******************** # |
36 | # * * # | 36 | # * * # |
37 | # * HISTORY * # | 37 | # * HISTORY * # |
38 | # * * # | 38 | # * * # |
39 | # ******************** # | 39 | # ******************** # |
40 | ######################## | 40 | ######################## |
41 | 41 | ||
42 | # Eternal bash history. | 42 | # Eternal bash history. |
43 | # --------------------- | 43 | # --------------------- |
44 | export HISTFILESIZE= | 44 | export HISTFILESIZE= |
45 | export HISTSIZE= | 45 | export HISTSIZE= |
46 | export HISTTIMEFORMAT="[%F %T] " | 46 | export HISTTIMEFORMAT="[%F %T] " |
47 | # Change the file location | 47 | # Change the file location |
48 | export HISTFILE=~/.new_bash_history | 48 | export HISTFILE=~/.config/new_bash_history |
49 | # Force prompt to write history after every command | 49 | # Force prompt to write history after every command |
50 | PROMPT_COMMAND="history -a; $PROMPT_COMMAND" | 50 | PROMPT_COMMAND="history -a; $PROMPT_COMMAND" |
51 | 51 | ||
52 | 52 | ||
53 | # check the window size after each command | 53 | # check the window size after each command |
54 | shopt -s checkwinsize | 54 | shopt -s checkwinsize~/.bash_aliases |
55 | 55 | ||
56 | # If set, the pattern "**" used in a pathname expansion context will | 56 | # If set, the pattern "**" used in a pathname expansion context will |
57 | # match all files and zero or more directories and subdirectories. | 57 | # match all files and zero or more directories and subdirectories. |
58 | #shopt -s globstar | 58 | #shopt -s globstar |
59 | 59 | ||
60 | # set variable identifying the chroot you work in (used in the prompt below) | 60 | # set variable identifying the chroot you work in (used in the prompt below) |
61 | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then | 61 | if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then |
62 | debian_chroot=$(cat /etc/debian_chroot) | 62 | debian_chroot=$(cat /etc/debian_chroot) |
63 | fi | 63 | fi |
64 | 64 | ||
65 | # set a fancy prompt | 65 | # set a fancy prompt |
66 | case "$TERM" in | 66 | case "$TERM" in |
67 | xterm-color) color_prompt=yes;; | 67 | xterm-color) color_prompt=yes;; |
68 | esac | 68 | esac |
69 | 69 | ||
70 | # colored prompt | 70 | # colored prompt |
71 | force_color_prompt=yes | 71 | force_color_prompt=yes |
72 | 72 | ||
73 | if [ -n "$force_color_prompt" ]; then | 73 | if [ -n "$force_color_prompt" ]; then |
74 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | 74 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then |
75 | # We have color support; assume it's compliant with Ecma-48 | 75 | # We have color support; assume it's compliant with Ecma-48 |
76 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such | 76 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such |
77 | # a case would tend to support setf rather than setaf.) | 77 | # a case would tend to support setf rather than setaf.) |
78 | color_prompt=yes | 78 | color_prompt=yes |
79 | else | 79 | else |
80 | color_prompt= | 80 | color_prompt= |
81 | fi | 81 | fi |
82 | fi | 82 | fi |
83 | 83 | ||
84 | if [ "$color_prompt" = yes ]; then | 84 | if [ "$color_prompt" = yes ]; then |
85 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' | 85 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' |
86 | else | 86 | else |
87 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' | 87 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' |
88 | fi | 88 | fi |
89 | #unset color_prompt force_color_prompt | 89 | #unset color_prompt force_color_prompt |
90 | 90 | ||
91 | # enable color support of ls and also add handy aliases | 91 | # enable color support of ls and also add handy aliases |
92 | if [ -x /usr/bin/dircolors ]; then | 92 | if [ -x /usr/bin/dircolors ]; then |
93 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | 93 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" |
94 | alias ls='ls --color=auto' | 94 | alias ls='ls --color=auto' |
95 | alias dir='dir --color=auto' | 95 | alias dir='dir --color=auto' |
96 | alias vdir='vdir --color=auto' | 96 | alias vdir='vdir --color=auto' |
97 | 97 | ||
98 | alias grep='grep --color=auto' | 98 | alias grep='grep --color=auto' |
99 | alias fgrep='fgrep --color=auto' | 99 | alias fgrep='fgrep --color=auto' |
100 | alias egrep='egrep --color=auto' | 100 | alias egrep='egrep --color=auto' |
101 | fi | 101 | fi |
102 | 102 | ||
103 | 103 | ||
104 | # Alias definitions | 104 | # Alias definitions |
105 | 105 | ||
106 | if [ -f ~/.bash_aliases ]; then | 106 | if [ -f ~/.config/zsh-config/templates/bash_aliases ]; then |
107 | . ~/.bash_aliases | 107 | . ~/.config/zsh-config/templates/bash_aliases |
108 | fi | 108 | fi |
109 | 109 |
templates/zshrc.sh
1 | #@IgnoreInspection AddShebang | 1 | #@IgnoreInspection AddShebang |
2 | # ENVIRONMENT: | 2 | # ENVIRONMENT: |
3 | export GJ_DEVENV=local_aptproxy | 3 | export GJ_DEVENV=local_aptproxy |
4 | 4 | ||
5 | export ZCFG=~/.config/zsh-config | 5 | export ZCFG=~/.config/zsh-config |
6 | # Path to your oh-my-zsh installation. | 6 | # Path to your oh-my-zsh installation. |
7 | export ZSH=$ZCFG/tools/oh-my-zsh | 7 | export ZSH=$ZCFG/packages/oh-my-zsh |
8 | 8 | ||
9 | # Set name of the theme to load. | 9 | export LANG=en_US.UTF-8 |
10 | # Look in ~/.oh-my-zsh/themes/ | 10 | |
11 | # Optionally, if you set this to "random", it'll load a random theme each | 11 | # Compilation flags |
12 | # time that oh-my-zsh is loaded. | 12 | export ARCHFLAGS="-arch x86_64" |
13 | |||
14 | # Themes are in (...)/oh-my-zsh/themes/ or "random" | ||
13 | ZSH_THEME="muse" | 15 | ZSH_THEME="muse" |
14 | 16 | ||
15 | CASE_SENSITIVE="true" | 17 | CASE_SENSITIVE="true" |
16 | DISABLE_AUTO_UPDATE="true" | 18 | DISABLE_AUTO_UPDATE="true" |
17 | DISABLE_AUTO_TITLE="true" | 19 | DISABLE_AUTO_TITLE="true" |
18 | ENABLE_CORRECTION="true" | 20 | ENABLE_CORRECTION="true" |
19 | COMPLETION_WAITING_DOTS="true" | 21 | COMPLETION_WAITING_DOTS="true" |
20 | DISABLE_UNTRACKED_FILES_DIRTY="true" | 22 | DISABLE_UNTRACKED_FILES_DIRTY="true" |
21 | HIST_STAMPS="dd.mm.yyyy" | 23 | HIST_STAMPS="dd.mm.yyyy" |
22 | ZSH_CUSTOM=ZCFG/custom | 24 | ZSH_CUSTOM=ZCFG/custom |
23 | 25 | ||
24 | plugins=(command-not-found common-aliases debian dirhistory git history history-substring-search systemadmin zsh_reload | 26 | plugins=(command-not-found common-aliases debian dirhistory git history history-substring-search systemadmin zsh_reload |
25 | pip python virtualenv virtualenvwrapper | 27 | pip python virtualenv virtualenvwrapper |
26 | meteor node npm | 28 | meteor node npm |
27 | ) | 29 | ) |
28 | 30 | ||
31 | #if [ -f ~/.config/zsh-config/templates/bash_aliases ]; then | ||
32 | # . ~/.config/zsh-config/templates/bash_aliases | ||
33 | #fi | ||
34 | |||
29 | # User configuration | 35 | # User configuration |
30 | export PATH=$HOME/bin:/usr/local/bin:$PATH | 36 | export PATH=$HOME/bin:/usr/local/bin:$PATH |
31 | # export MANPATH="/usr/local/man:$MANPATH" | 37 | # export MANPATH="/usr/local/man:$MANPATH" |
32 | 38 | ||
33 | source $ZSH/oh-my-zsh.sh | 39 | source ~/.zshrc |
34 | export LANG=en_US.UTF-8 | 40 | |
41 | # source $ZSH/oh-my-zsh.sh | ||
35 | 42 | ||
36 | # ANTIGEN: | 43 | # ANTIGEN: |
37 | # | 44 | # |
38 | # source $ZCFG/tools/antigen/antigen.zsh | 45 | # source $ZCFG/packages/antigen/antigen.zsh |
39 | # | 46 | # |
40 | # MUST: | 47 | # MUST: |
41 | #antigen bundle extract | 48 | #antigen bundle extract |
42 | # | 49 | # |
43 | # | 50 | # |
44 | # NICE: | 51 | # NICE: |
45 | #antigen bundle iwhois | 52 | #antigen bundle iwhois |
46 | #antigen bundle screen | 53 | #antigen bundle screen |
47 | #antigen bundle ssh-agent | 54 | #antigen bundle ssh-agent |
48 | #antigen bundle web-search | 55 | #antigen bundle web-search |
49 | # # if webdev: | 56 | # # if webdev: |
50 | #antigen bundle catimg | 57 | #antigen bundle catimg |
51 | # | 58 | # |
52 | # docker: | 59 | # docker: |
53 | #antigen bundle docker | 60 | #antigen bundle docker |
54 | # | 61 | # |
55 | # kde: | 62 | # kde: |
56 | #antigen bundle kate | 63 | #antigen bundle kate |
57 | # | 64 | # |
58 | # removed: | 65 | # removed: |
59 | #antigen bundle autoenv | 66 | #antigen bundle autoenv |
60 | #antigen bundle iwhois | 67 | #antigen bundle iwhois |
61 | #antigen bundle per-directory-history | 68 | #antigen bundle per-directory-history |
62 | #antigen bundle screen | 69 | #antigen bundle screen |
63 | # | 70 | # |
64 | # THEME #---------- | 71 | # THEME #---------- |
65 | # | 72 | # |
66 | #antigen theme muse | 73 | #antigen theme muse |
67 | # | 74 | # |
68 | #antigen apply | 75 | #antigen apply |
69 | 76 | ||
70 | # ssh | 77 | # ssh |
71 | # export SSH_KEY_PATH="~/.ssh/id_rsa" | 78 | # export SSH_KEY_PATH="~/.ssh/id_rsa" |
72 | # zstyle :omz:plugins:ssh-agent agent-forwarding on | 79 | # zstyle :omz:plugins:ssh-agent agent-forwarding on |
73 | 80 | ||
74 | # Preferred editor for local and remote sessions | 81 | # Preferred editor for local and remote sessions |
75 | # if [[ -n $SSH_CONNECTION ]]; then | 82 | # if [[ -n $SSH_CONNECTION ]]; then |
76 | # export EDITOR='vim' | 83 | # export EDITOR='vim' |
77 | # else | 84 | # else |
78 | # export EDITOR='mvim' | 85 | # export EDITOR='mvim' |
79 | # fi | 86 | # fi |
80 |
tools/install.sh
1 | #@IgnoreInspection AddShebang | 1 | #@IgnoreInspection AddShebang |
2 | # ** Initiate with: ** | 2 | # |
3 | # cd && wget http://git.str8.biz/mj/zsh-config/raw/master/tools/install.sh -O -| sh | 3 | # ** Initiate with: ** |
4 | # ----------------------------------------------------------------------------------- | 4 | # cd && curl -L http://git.str8.biz/mj/zsh-config/raw/master/tools/install.sh | sh |
5 | # | ||
6 | # --------------------------------------------------------------------------------------------- | ||
7 | # | ||
8 | # gj@ubuntu4docker:~$ touch install.sh | ||
9 | # gj@ubuntu4docker:~$ rm install.sh && nano install.sh && chmod +x install.sh && ./install.sh | ||
10 | # | ||
11 | ################################################################################################ | ||
5 | 12 | ||
6 | set -e | 13 | set -e |
7 | 14 | ||
8 | if [ "$SHELL" != "$(which zsh)" ]; then | 15 | if [ "$SHELL" != "$(which zsh)" ]; then |
9 | echo "$(which zsh)" | 16 | echo "$(which zsh)" |
10 | sudo echo "enter pass...." | 17 | sudo echo "enter pass...." |
11 | 18 | ||
12 | echo "ok" | 19 | echo "ok" |
13 | 20 | ||
14 | sudo apt-get -yq install curl dialog nano python-setuptools zsh | 21 | sudo apt-get -yq install curl dialog git nano zsh |
22 | #sudo apt-get -yq python-setuptools | ||
15 | 23 | ||
16 | sudo easy_install pip | 24 | #sudo easy_install pip |
17 | sudo pip install virtualenvwrapper | 25 | #sudo pip install virtualenvwrapper |
18 | fi | 26 | fi |
19 | 27 | ||
20 | if [ 1 == 1 ]; then | 28 | if [ 1 == 2 ]; then |
21 | mkvirtualenv cb-meteor | 29 | mkvirtualenv cb-meteor |
22 | pip install nodeenv | 30 | pip install nodeenv |
23 | nodeenv -p | 31 | nodeenv -p |
24 | curl https://install.meteor.com/ | sh | 32 | # curl https://install.meteor.com/ | sh |
25 | fi | 33 | fi |
26 | 34 | ||
27 | if [ ! -n "$ZCNF" ]; then | 35 | if [ ! -n "$ZCNF" ]; then |
28 | ZCNF=~/.config/zsh-config | 36 | ZCNF=~/.config/zsh-config |
29 | fi | 37 | fi |
30 | 38 | ||
31 | if [ ! -n "$ZSH" ]; then | 39 | if [ ! -n "$ZSH" ]; then |
32 | ZSH=$ZCNF/tools/oh-my-zsh | 40 | ZSH=$ZCNF/packages/oh-my-zsh |
33 | fi | 41 | fi |
34 | 42 | ||
35 | echo "\033[0;34mCleaning...\033[0m" | 43 | echo "\033[0;34mCleaning...\033[0m" |
36 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then | 44 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then |
37 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then | 45 | if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then |
38 | rm -rf ~/.config/zsh-config | 46 | rm -rf ~/.config/zsh-config |
39 | fi | 47 | fi |
40 | # if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then | 48 | # if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then |
41 | # rm -rf ~/.config/oh-my-zsh | 49 | # rm -rf ~/.config/oh-my-zsh |
42 | # fi | 50 | # fi |
43 | if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then | 51 | if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then |
44 | rm -rf ~/.config/antigen | 52 | rm -rf ~/.config/antigen |
45 | fi | 53 | fi |
46 | fi | 54 | fi |
47 | 55 | ||
48 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then | 56 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then |
49 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf | 57 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf |
50 | fi | 58 | fi |
51 | # | 59 | # |
52 | # BASH: | 60 | # BASH: |
53 | # | 61 | # |
54 | if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then | 62 | if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then |
55 | mv ~/.bashrc ~/.bashrc.pre-zsh-cnf | 63 | mv ~/.bashrc ~/.bashrc.pre-zsh-cnf |
56 | fi | 64 | fi |
57 | if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then | 65 | if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then |
58 | rm ~/.bash_aliases | 66 | rm ~/.bash_aliases |
59 | fi | 67 | fi |
60 | 68 | ||
61 | echo "\033[0;34mCloning Zsh Config...\033[0m" | 69 | echo "\033[0;34mCloning Zsh Config...\033[0m" |
62 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { | 70 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { |
63 | echo "can't clone repo.." | 71 | echo "can't clone repo.." |
64 | exit 1 | 72 | exit 1 |
65 | } | 73 | } |
66 | 74 | ||
67 | echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" | 75 | echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" |
68 | ln -s $ZCNF/templates/zshrc.sh ~/.zshrc | 76 | cp $ZCNF/templates/zshrc.sh ~/.zshrc |
69 | ln -s $ZCNF/templates/bashrc.sh ~/.bashrc | 77 | cp $ZCNF/templates/bashrc.sh ~/.bashrc |
70 | ln -s $ZCNF/templates/bash_aliases.sh ~/.bash_aliases | 78 | # ln -s $ZCNF/templates/bash_aliases.sh ~/.bash_aliases |
71 | sed -i -e "/^export ZSH=/ c\\ | 79 | sed -i -e "/^export ZSH=/ c\\ |
72 | export ZSH=$ZSH | 80 | export ZSH=$ZSH |
73 | " ~/.zshrc | 81 | " ~/.zshrc |
74 | 82 | ||
75 | echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" | 83 | echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" |
76 | sed -i -e "/export PATH=/ c\\ | 84 | sed -i -e "/export PATH=/ c\\ |
77 | export PATH=\"$PATH\" | 85 | export PATH=\"$PATH\" |
78 | " ~/.zshrc | 86 | " ~/.zshrc |
79 | 87 | ||
80 | if [ "$SHELL" != "$(which zsh)" ]; then | 88 | if [ "$SHELL" != "$(which zsh)" ]; then |
81 | echo "\033[0;34mTime to change your default shell to zsh!\033[0m" | 89 | echo "\033[0;34mTime to change your default shell to zsh!\033[0m" |
82 | echo "chsh -s $(which zsh)" | 90 | # echo "chsh -s $(which zsh)" |
91 | echo "chsh -s /bin/zsh" | ||
83 | fi | 92 | fi |
84 | 93 | ||
85 | echo "\033[0;32m"' __ __ '"\033[0m" | 94 | echo "\033[0;32m"' __ __ '"\033[0m" |
86 | echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" | 95 | echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" |
87 | echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" | 96 | echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" |
88 | echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" | 97 | echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" |
89 | echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" | 98 | echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" |
90 | echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" | 99 | echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" |
91 | echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" | 100 | echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" |
92 | echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" | 101 | echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" |
93 | echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" | 102 | echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" |
94 | #env zsh | 103 | #env zsh |
95 | #. ~/.zshrc | 104 | #. ~/.zshrc |
96 | 105 |
tools/sys_base_install.sh
1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env bash |
2 | 2 | ||
3 | # ** Initiate with: ** | 3 | # ** Initiate with: ** |
4 | # cd && wget http://git.str8.biz/mj/zsh-config/raw/master/tools/sys_base_install.sh -O | sh | 4 | # cd && wget http://git.str8.biz/mj/zsh-config/raw/master/tools/sys_base_install.sh -O | sh |
5 | # ------------------------------------------------------------------------------------------- | 5 | # ------------------------------------------------------------------------------------------- |
6 | 6 | ||
7 | # ** Helper Functions ** | 7 | set -e |
8 | # ---------------------- | ||
9 | 8 | ||
10 | export GJ_DEVENV="local_aptproxy" | 9 | export GJ_DEVENV="local_aptproxy" |
11 | export GJ_SHELL="bash" | 10 | export GJ_SHELL="bash" |
12 | 11 | ||
12 | # ** Helper Functions ** | ||
13 | # ---------------------- | ||
14 | |||
13 | function set_apt_proxy { | 15 | function set_apt_proxy { |
14 | if [[ "$GJ_DEVENV" == "local_aptproxy" ]]; then | 16 | if [[ "$GJ_DEVENV" == "local_aptproxy" ]]; then |
15 | echo "Setting apt-proxy: srvths" | 17 | echo "Setting apt-proxy: srvths" |
16 | printf 'Acquire::http { Proxy "http://192.168.188.110:3142"; };\nAcquire::https { Proxy "https://"; };\n' > /etc/apt/apt.conf.d/02proxy | 18 | printf 'Acquire::http { Proxy "http://192.168.188.110:3142"; };\nAcquire::https { Proxy "https://"; };\n' > /etc/apt/apt.conf.d/02proxy |
17 | elif [[ "$GJ_DEVENV" == "hetzner_server" ]]; then | 19 | elif [[ "$GJ_DEVENV" == "hetzner_server" ]]; then |
18 | echo "Setting apt-mirror: hetzner mirror" | 20 | echo "Setting apt-mirror: hetzner mirror" |
19 | echo 'deb ftp://mirror.hetzner.de/debian/packages wheezy main contrib non-free' > /etc/apt/sources.list.d/hetzner.list | 21 | echo 'deb ftp://mirror.hetzner.de/debian/packages wheezy main contrib non-free' > /etc/apt/sources.list.d/hetzner.list |
20 | echo 'deb ftp://mirror.hetzner.de/debian/security wheezy/updates main contrib non-free' >> /etc/apt/sources.list.d/hetzner.list | 22 | echo 'deb ftp://mirror.hetzner.de/debian/security wheezy/updates main contrib non-free' >> /etc/apt/sources.list.d/hetzner.list |
21 | fi | 23 | fi |
22 | } | 24 | } |
23 | 25 | ||
24 | function get_shell_config { | 26 | function get_shell_config { |
25 | apt-get -yq install apt-utils curl git nano zsh | 27 | apt-get -yq install apt-utils curl git nano zsh |
26 | mkdir ~/.config | 28 | mkdir ~/.config |
27 | echo "cloning zsh config.." | 29 | echo "cloning zsh config.." |
28 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF | 30 | hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF |
29 | } | 31 | } |
30 | 32 | ||
31 | set_apt_proxy | 33 | set_apt_proxy |
32 | 34 | ||
33 | set -e | 35 | set -e |
34 | 36 | ||
35 | if [ ! -n "$ZCNF" ]; then | 37 | if [ ! -n "$ZCNF" ]; then |
36 | ZCNF=~/.config/zsh-config | 38 | ZCNF=~/.config/zsh-config |
37 | fi | 39 | fi |
38 | 40 | ||
39 | if [ ! -n "$ZSH" ]; then | 41 | if [ ! -n "$ZSH" ]; then |
40 | ZSH=$ZCNF/tools/oh-my-zsh | 42 | ZSH=$ZCNF/packages/oh-my-zsh |
41 | fi | 43 | fi |
42 | 44 | ||
43 | #export DEBIAN_FRONTEND=noninteractive | 45 | #export DEBIAN_FRONTEND=noninteractive |
44 | 46 | ||
45 | apt-get update | 47 | apt-get update |
46 | 48 | ||
47 | if [ "$GJ_SHELL" != "zsh" ]; then | 49 | if [ "$GJ_SHELL" != "zsh" ]; then |
48 | get_shell_config | 50 | get_shell_config |
49 | fi | 51 | fi |
50 | 52 | ||
51 | apt-get -yq upgrade && apt-get -yq dist-upgrade | 53 | apt-get -yq upgrade && apt-get -yq dist-upgrade |
52 | apt-get -yq install locales-all localepurge makepasswd python-setuptools | 54 | apt-get -yq install locales-all localepurge makepasswd python-setuptools |
53 | apt-get -yq autoremove && apt-get -yq clean | 55 | apt-get -yq autoremove && apt-get -yq clean |
54 | 56 | ||
55 | dpkg-reconfigure localepurge | 57 | dpkg-reconfigure localepurge |
56 | dpkg-reconfigure tzdata | 58 | dpkg-reconfigure tzdata |
57 | 59 | ||
58 | easy_install pip | 60 | easy_install pip |
59 | pip install autoenv | 61 | pip install autoenv |
60 | mkdir .autoenv && ln -s /usr/local/bin/activate.sh .autoenv/activate.sh | 62 | mkdir .autoenv && ln -s /usr/local/bin/activate.sh .autoenv/activate.sh |
61 | 63 | ||
62 | echo "\033[0;34mLooking for an existing zsh config...\033[0m" | 64 | echo "\033[0;34mLooking for an existing zsh config...\033[0m" |
63 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then | 65 | if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then |
64 | echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-zsh-cnf\033[0m"; | 66 | echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-zsh-cnf\033[0m"; |
65 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf; | 67 | mv ~/.zshrc ~/.zshrc.pre-zsh-cnf; |
66 | fi | 68 | fi |
67 | 69 | ||
68 | echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" | 70 | echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" |
69 | ln -s $ZCNF/templates/zshrc ~/.zshrc | 71 | ln -s $ZCNF/templates/zshrc ~/.zshrc |
70 | ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases | 72 | ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases |
71 | sed -i -e "/^export ZSH=/ c\\ | 73 | sed -i -e "/^export ZSH=/ c\\ |
72 | export ZSH=$ZSH | 74 | export ZSH=$ZSH |
73 | " ~/.zshrc | 75 | " ~/.zshrc |
74 | 76 | ||
75 | echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" | 77 | echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" |
76 | sed -i -e "/export PATH=/ c\\ | 78 | sed -i -e "/export PATH=/ c\\ |
77 | export PATH=\"$PATH\" | 79 | export PATH=\"$PATH\" |
78 | " ~/.zshrc | 80 | " ~/.zshrc |
79 | 81 | ||
80 | if [ "$SHELL" != "$(which zsh)" ]; then | 82 | if [ "$SHELL" != "$(which zsh)" ]; then |
81 | echo "\033[0;34mTime to change your default shell to zsh!\033[0m" | 83 | echo "\033[0;34mTime to change your default shell to zsh!\033[0m" |
82 | chsh -s `which zsh` | 84 | chsh -s `which zsh` |
83 | fi | 85 | fi |
84 | 86 | ||
85 | echo "\033[0;32m"' __ __ '"\033[0m" | 87 | echo "\033[0;32m"' __ __ '"\033[0m" |
86 | echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" | 88 | echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" |
87 | echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" | 89 | echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" |
88 | echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" | 90 | echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" |
89 | echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" | 91 | echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" |
90 | echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" | 92 | echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" |
91 | echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" | 93 | echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" |
92 | echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" | 94 | echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" |
93 | echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" | 95 | echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" |
94 | env zsh | 96 | env zsh |
95 | . ~/.zshrc | 97 | . ~/.zshrc |