-
Notifications
You must be signed in to change notification settings - Fork 135
/
install.sh
executable file
·176 lines (152 loc) · 4.93 KB
/
install.sh
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#!/bin/sh
source basic.sh
if [[ ! -e /usr/local/bin/sslocal ]]; then
brew install shadowsocks-libev
brew services start shadowsocks-libev
ln -s /usr/local/opt/shadowsocks-libev/bin/ss-local /usr/local/bin/sslocal
ln -s /usr/local/opt/shadowsocks-libev/bin/ss-server /usr/local/bin/ss-server
else
echo "You have installed shadowsocks"
fi
# install and use shadowsocks
if not_tt_network; then
nohup sslocal -c ~/.macbootstrap/tools/netconf &> /private/tmp/nohup.out&
#export ALL_PROXY=socks5://127.0.0.1:14179
else
echo "You are in toutiao network, no need to use ss now"
fi
if [[ ! -e /Applications/iTerm.app ]]; then
brew cask install iterm2
defaults delete com.googlecode.iterm2
ln -s ~/.macbootstrap/config/com.googlecode.iterm2.plist $HOME/Library/Preferences
# config background image location
command="set :New\ Bookmarks:0:Background\ Image\ Location /Users/""$(whoami)""/.macbootstrap/assets/iterm-background.jpg"
# Disable Background for performance issue
#/usr/libexec/PlistBuddy -c "$command" $HOME/Library/Preferences/com.googlecode.iterm2.plist
defaults read -app iTerm >/dev/null
else
echo "You have installed iTerm2"
fi
if [[ ! -e /Applications/SourceTree.app ]]; then
brew cask install sourcetree
else
echo "You have installed SourceTree"
fi
if [[ ! -e /Applications/WeChat.app ]]; then
brew cask install wechat
else
echo "You have installed WeChat"
fi
if [[ ! -e /Applications/Google\ Chrome.app ]]; then
brew cask install google-chrome
# Set Chrome as default browser
git clone https://github.com/kerma/defaultbrowser ./tools/defaultbrowser
(cd ./tools/defaultbrowser && make && make install)
defaultbrowser chrome
[[ -d ./tools/defaultbrowser ]] && rm -rf ./tools/defaultbrowser
else
echo "You have installed chrome"
fi
if [[ ! -e /Applications/Visual\ Studio\ Code.app ]]; then
brew cask install visual-studio-code
sh ./vscode/setup.sh
else
echo "You have installed vscode"
fi
if brew ls --versions gnu-sed > /dev/null; then
echo "You have installed gsed"
else
brew install gnu-sed
fi
# install sz/rz
if brew ls --versions lrzsz > /dev/null; then
echo "You have installed lrzsz"
else
brew install lrzsz
fi
# install coreutils
if [[ ! -e /usr/local/opt/coreutils ]]; then
brew install coreutils
cp /usr/local/opt/coreutils/libexec/gnubin/gls /usr/local/opt/coreutils/libexec/gnubin/ls
else
echo "You have installed coreutils"
fi
# install jetbrain toolbox
if [[ ! -e /Applications/JetBrains\ Toolbox.app ]]; then
brew cask install jetbrains-toolbox
else
echo "You have installed JetBrains Toolbox"
fi
brew install --HEAD universal-ctags/universal-ctags/universal-ctags
brew install redis
brew_install python3
brew_install cmake
brew_install gawk
brew_install autojump
brew_install wget
brew_install nvm
brew_install exiv2
brew_install ssh-copy-id
brew_install imagemagick
brew_install catimg
brew_install gpg
brew_install icdiff
brew_install scmpuff
brew_install fzf
brew_install fd
brew_install the_silver_searcher
brew_install nvim
brew_install exiftool
brew_install archey
brew_install ranger
brew_install git-lfs && git lfs install
brew_install cloc
$(brew --prefix)/opt/fzf/install --all
# link git config
mv ~/.gitconfig ~/.gitconfig_backup
backup_file ~/.gitattributes
ln -s ~/.macbootstrap/git-config/.gitconfig ~/.gitconfig
ln -s ~/.macbootstrap/git-config/.gitattributes ~/.gitattributes
if [[ ! -e ~/.oh-my-zsh ]]; then
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
fi
# zshrc setup
backup_file ~/.zshrc
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
ln -s ~/.macbootstrap/zsh-config/.zshrc ~/.zshrc
# vim configuration
backup_file ~/.vim
backup_file ~/.config/nvim/
git clone https://github.com/bestswifter/vim-config.git ~/.config/nvim
ln -s ~/.config/nvim ~/.vim
backup_file ~/.ideavimrc
ln -s ~/.config/ideavimrc ~/.ideavimrc
# ESLint configuration
backup_file ~/.eslintrc.js
backup_file ~/.eslintrc
ln -s ~/.macbootstrap/.eslintrc.js ~/.eslintrc.js
# Ranger configuration
if [[ ! -e $HEME/.config/ranger ]]; then
mkdir -p $HOME/.config/ranger
fi
old_commands_py=$HOME/.config/ranger/commands.py
old_rc_conf=$HOME/.config/ranger/rc.conf
backup_file "$old_commands_py"
backup_file "$old_rc_conf"
ln -s ~/.macbootstrap/config/ranger/commands.py "$old_commands_py"
ln -s ~/.macbootstrap/config/ranger/rc.conf "$old_rc_conf"
./install-steps/dependencies.before.sh
unset ALL_PROXY
./install-steps/dependencies.after.sh
sudo ./install-steps/macos.sh
./install-steps/sogou_sync.sh
# ssh configuration
backup_file ~/.ssh/config
if [[ ! -e ~/.ssh ]]; then
mkdir ~/.ssh
fi
ln -s ~/.macbootstrap/zsh-config/ssh_config ~/.ssh/config
# Personal
./install-steps/personal.sh
./personal.sh