This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
Β·238 lines (194 loc) Β· 7.94 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
#!/bin/bash
set -e
dotfilesdir=(
lf
git
mpv
zsh
nvim
skhd
tmux
yabai
kitty
python
stylua
vscode
eslint
flake8
lazygit
zathura
homebrew
neofetch
prettier
karabiner
sketchybar
pipe-viewer
)
if [ "$1" = '-go' ]; then
/usr/bin/caffeinate -d &
########################## HOMEBREW #################################
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
brew reinstall git || brew install git
brew link git || brew link --overwrite git
brew reinstall stow || brew install stow
brew reinstall mpv || brew install mpv
brew tap zegervdv/zathura
brew reinstall zathura || brew install zathura
brew reinstall zathura-pdf-poppler || brew install zathura-pdf-poppler
mkdir -p "$(brew --prefix zathura)/lib/zathura"
ln -sf "$(brew --prefix zathura-pdf-poppler)/libpdf-poppler.dylib" "$(brew --prefix zathura)/lib/zathura/libpdf-poppler.dylib"
# INFO
# with yabai --head everything work but if you re-run this script
# and restart your system you must regenerate shasum -a 256 $(which yabai) | awk '{print $1}'
# and replace into sha(hash) with sudo visudo -f /private/etc/sudoers.d/yabai
# go to yabai documentation github, and read issue for macos ventura
brew tap koekeishiya/formulae
brew reinstall yabai --HEAD || brew install yabai --HEAD
codesign -fs 'yabai-cert' "$(which yabai)"
# STOW MY DOTFILES
if [ -d "$HOME/.dotfiles" ]; then
cd ~/.dotfiles && stow -v "${dotfilesdir[@]}"
ln -sf -v ~/.dotfiles/scripts/** /usr/local/bin/
fi
ln -sf -v ~/.config/zsh/.zprofile ~/.zprofile
echo "Package Update πΊ..."
brew update --verbose --force && brew upgrade
echo "Package Update From Brewfile ποΈ..."
brew bundle -v --file=~/.config/brewfile/Brewfile
# usr/local/share/zsh
if [ -d "/usr/local/share/zsh/site-functions" ]; then
rm -rf -v /usr/local/share/zsh/site-functions
mkdir -p -v /usr/local/share/zsh/site-functions
else
mkdir -p -v /usr/local/share/zsh/site-functions
fi
sudo ln -sf -v /opt/homebrew/share/zsh/site-functions/** /usr/local/share/zsh/site-functions
###################### DOCKER #########################
if [ -d "/opt/homebrew/opt/docker-compose" ]; then
if [ -d "$HOME/.docker/cli-plugins" ]; then
ln -sfn -v "$(brew --prefix)/opt/docker-compose/bin/docker-compose" ~/.docker/cli-plugins/docker-compose
else
mkdir -p -v ~/.docker/cli-plugins
ln -sfn -v "$(brew --prefix)/opt/docker-compose/bin/docker-compose" ~/.docker/cli-plugins/docker-compose
fi
fi
###################### DOCKER #########################
###################### COREUTILS #########################
sudo ln -sf -v /opt/homebrew/bin/bash /usr/local/bin/bash
sudo ln -sf -v /opt/homebrew/bin/gsed /usr/local/bin/sed
sudo ln -sf -v /opt/homebrew/bin/ggrep /usr/local/bin/grep
###################### COREUTILS #########################
########################## HOMEBREW #################################
########################## PYTHON UTILS #################################
python3.10 -m pip install --upgrade pip
pip3 install --ignore-installed pynvim
pip3 install --ignore-installed flake8
pip3 install --ignore-installed black
pip3 install --ignore-installed isort
########################## PYTHON UTILS #################################
########################## OSX UTILS #################################
# DESKTOP-UTILITY
if [ -d "$HOME/.local/share/desktop-image-switcher" ]; then
rm -rf -v ~/.local/share/desktop-image-switcher
git clone https://github.com/GabrielDougherty/desktop-image-switcher ~/.local/share/desktop-image-switcher
cd ~/.local/share/desktop-image-switcher && sudo make install
else
rm -rf -v /usr/local/bin/desktop-image-switcher
git clone https://github.com/GabrielDougherty/desktop-image-switcher ~/.local/share/desktop-image-switcher
cd ~/.local/share/desktop-image-switcher && sudo make install
fi
# YT-MUSIC-API-UTILITY
if [ -d "$HOME/.local/share/pipe-viewer-main" ]; then
sudo rm -rf -v ~/.local/share/pipe-viewer-main
wget https://github.com/trizen/pipe-viewer/archive/main.zip --no-check-certificate -O ~/.local/share/pipe-viewer-main.zip
unzip -d ~/.local/share ~/.local/share/pipe-viewer-main.zip
cd ~/.local/share/pipe-viewer-main && perl Build.PL && sudo ./Build installdeps && sudo ./Build install
rm -rf -v ~/.local/share/pipe-viewer-main.zip
else
wget https://github.com/trizen/pipe-viewer/archive/main.zip --no-check-certificate -O ~/.local/share/pipe-viewer-main.zip
unzip -d ~/.local/share ~/.local/share/pipe-viewer-main.zip
cd ~/.local/share/pipe-viewer-main && perl Build.PL && sudo ./Build installdeps && sudo ./Build install
rm -rf -v ~/.local/share/pipe-viewer-main.zip
fi
# BRIGHTNESS
if [ -d "$HOME/.local/share/brightness" ]; then
sudo rm -rf -v ~/.local/share/brightness
git clone https://github.com/nriley/brightness.git ~/.local/share/brightness
cd ~/.local/share/brightness
make
sudo make install
else
git clone https://github.com/nriley/brightness.git ~/.local/share/brightness
cd ~/.local/share/brightness
make
sudo make install
fi
########################## OSX UTILS #################################
########################## NODEJS #################################
if [ -d "/opt/homebrew/opt/nvm/" ]; then
/usr/local/bin/bloatednvmstupidshit
fi
########################## NODEJS #################################
########################## NEOVIM #################################
# NEOVIM SOURCE
if [ -d "$HOME/.local/share/neovim" ]; then
sudo rm -rf -v ~/.local/share/neovim
sudo rm -rf -v /usr/local/bin/nvim
sudo rm -rf -v /usr/local/share/nvim
git clone https://github.com/neovim/neovim ~/.local/share/neovim
cd ~/.local/share/neovim
git checkout v0.7.2
make CMAKE_BUILD_TYPE=Release
sudo make install
else
git clone https://github.com/neovim/neovim ~/.local/share/neovim
cd ~/.local/share/neovim
git checkout v0.7.2
make CMAKE_BUILD_TYPE=Release
sudo make install
fi
# NEOVIM PACKER INSTALL
if [ -d "$HOME/.local/share/nvim" ]; then
sudo rm -rf -v "$HOME/.local/share/nvim"
git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
nvim -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
nvim -c 'TSUpdate' -c 'Mason'
else
git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
nvim -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
nvim -c 'TSUpdate' -c 'Mason'
fi
########################## NEOVIM #################################
########################## TMUX PLUG #################################
export TMUX_PLUGIN_MANAGER_PATH="${HOME}/.config/tmux/plugins"
if [ -d "$HOME/.config/tmux/plugins" ]; then
rm -rf -v ~/.config/tmux/plugins
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
"$HOME/.config/tmux/plugins/tpm/bin/install_plugins"
else
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
"$HOME/.config/tmux/plugins/tpm/bin/install_plugins"
fi
########################## TMUX PLUG #################################
echo "Package Cleanup π..."
brew cleanup && brew cleanup --prune=all
brew autoremove
/usr/local/bin/clean -g
echo "Package Info ποΈ..."
brew info
echo "Package Bundle π¦..."
brew bundle dump --desc --force --file=~/.config/brewfile/Brewfile
echo "Package Check β
..."
brew doctor
read -r -p "Process Complete π..." -t 5 | tr '%' '\n'
sleep 2 && kill -9 "$(ps -ax -o pid,comm | sort | grep caffeinate | awk 'NR==1{print $1}')" 2>/dev/null
sleep 2 && kill -9 "$(ps -ax -o pid,comm | sort | grep -E "(terminal|kitty|iterm2|alacritty)" | awk 'NR==1{print $1}')" 2>/dev/null
elif [ -n "$1" ]; then
echo "install.sh failed π
"
echo "install.sh -go for started π§"
exit
else
echo "install.sh failed π
"
echo "install.sh -go for started π§"
fi