-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathterminal-Setup.sh
More file actions
executable file
·102 lines (79 loc) · 2.42 KB
/
terminal-Setup.sh
File metadata and controls
executable file
·102 lines (79 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/usr/bin/env bash
brew_install() {
if brew list $1 > /dev/null; then
echo "${1} is already installed"
else
brew install $1 && echo "$1 is installed"
fi
}
does_file_exist() {
if test -f $1; then
mv $1 $1"_old"
echo $1 "already exsists old configuraltion moved to" $1"_old"
else
echo "$1 already exist"
fi
}
does_dir_exist() {
if [ ! -d $1 ]; then
eval "$2"
else
echo "$1 already exist"
fi
}
CWD=$(pwd)
# Homebrew install
which -s brew
if [[ $? != 0 ]] ; then
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
brew update
fi
# oh-my-zsh
does_dir_exist "~/.oh-my-zsh" 'sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended'
# Python
brew_install python
# Powerline Status bar
pip3 install --user powerline-status
# Patched fonts install
brew tap homebrew/cask-fonts && brew_install "--cask font-fira-code"
# pre .zshrc dependencies
# Dev
does_dir_exist "~/repos" "mkdir ~/repos"
# Python dev
does_dir_exist "~/.virtualenvs" "mkdir ~/.virtualenvs"
brew_install virtualenvwrapper
# Java
brew_install openjdk@11
# Kubctl - for intel silicon
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl"
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
# Oh my zsh Cobalt theme
does_dir_exist "~/.iterm_theme" "mkdir ~/.iterm_theme"
cd ~/.iterm_theme
does_dir_exist "Cobalt2-iterm" "git clone https://github.com/wesbos/Cobalt2-iterm.git"
cd ./Cobalt2-iterm
cp ./cobalt2.zsh-theme ~/.oh-my-zsh/themes/cobalt2.zsh-theme
# ZSH Plugins config
cd ~/.oh-my-zsh/custom/plugins
does_dir_exist "zsh-autosuggestions" "git clone https://github.com/zsh-users/zsh-autosuggestions.git"
does_dir_exist "zsh-syntax-highlighting" "git clone https://github.com/zsh-users/zsh-syntax-highlighting.git"
# Useful terminal utilities
brew_install "--cask iterm2"
brew_install "tldr"
brew_install "git"
# replace default zsh config
cd $CWD
ZSH_FILE=.zshrc
does_file_exist ~/$ZSH_FILE
cp dotfiles/$ZSH_FILE ~/$ZSH_FILE
# replace .vimrc file
VIM_FILE=.vimrc
does_file_exist ~/$VIM_FILE
cp dotfiles/$VIM_FILE ~/$VIM_FILE
# Show hidden files and folders
defaults write com.apple.Finder AppleShowAllFiles true
# Launch zsh
exec /bin/zsh
echo "Refer to post install instructions https://github.com/Michael1142/Terminal-Setup"