-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
198 lines (168 loc) Β· 6 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
echo π΄ WARNING!
echo π΄ Read the contents of this file carefully before running it
PWD="${HOME}/site/git/dotfiles"
# If system is not Darwin, exit with code 1:
if [ "$(uname 2> /dev/null)" != "Darwin" ]; then
echo π΄ This install script works only on macOS.
echo π΄ Modifications may be required to make it work on other platforms.
exit 1
fi
echo π΅ Install xcode Developer Tools
xcode-select --install
echo π΅ Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
brew doctor
brew tap homebrew/cask-versions
echo π΅ Install Homebrew Formulae and Casks
brew install curl
brew install wget
brew install git
brew install git-lfs
brew install fnm
brew install neovim
brew install openvpn
brew install ffmpeg
brew install gnupg
brew install pinentry-mac
brew install coreutils
brew install grep
brew install openssh
brew install screen
brew install terminal-notifier
brew install yt-dlp
brew install awk
brew install macos-trash
brew install gh
brew install rustup
brew install python
brew install --cask iterm2
# WARNING: this would install an Intel version of Docker
brew install --cask docker
# NOTE: at one point browser integration was only available in the
# App Store version of bitwarden - check if that is still the case
brew install --cask bitwarden
brew install --cask google-chrome-beta
brew install --cask firefox-developer-edition
brew install --cask visual-studio-code
brew install --cask vlc
brew install --cask obs
brew install --cask surfshark
brew install --cask zoom
brew install --cask vnc-viewer
brew install --cask transmission
brew install --cask raycast
# Set macOS defaults
"${PWD}./macos.sh"
# For silicon macs
PINETRY_LOCATION="/opt/homebrew/bin/pinentry-mac"
# For Intel macs
# PINETRY_LOCATION="/usr/local/bin/pinentry-mac"
echo π΅ Adding shortcut for Downloads directory
ln -s "${HOME}/Downloads" "${HOME}/d"
echo π΅ Creating directories
mkdir -p "${HOME}/site/git"
mkdir -p "${HOME}/site/python"
mkdir -p "${HOME}/site/javascript"
echo π΅ Cloning Git repos
(
cd "${HOME}/site/python"
git clone https://github.com/specify/specify7.git
git clone https://github.com/maxpatiiuk/dir-explorer.git
)
(
cd "${HOME}/site/git"
git clone https://github.com/specify/specify-tools.git
git clone https://github.com/maxpatiiuk/custom-new-tab-page.git
git clone https://github.com/maxpatiiuk/code-share.git
git clone https://github.com/maxpatiiuk/dotfiles.git
)
(
cd "${HOME}/site/javascript"
git clone https://github.com/maxpatiiuk/max.patii.uk.git
git clone https://github.com/maxpatiiuk/text-hoarder.git
)
echo π΅ Configure GNU PGP
mkdir -p ~/.gnupg
echo 'use-agent' > ~/.gnupg/gpg.conf
chmod -R 700 ~/.gnupg
echo π΅ "pinentry-program ${PINETRY_LOCATION}" >> ~/.gnupg/gpg-agent.conf
killall gpg-agent
echo π΅ Installing Node.js
fnm install 20
echo π΅ Installing Rust
rustup default stable
echo π΅ Install global Python dependencies
pip install wheel
echo π΅ Install global NPM dependencies
npm install -g npm-check-updates
npm install -g clipboardy
npm install -g typescript-language-server
echo π΅ Installing oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo π΅ Deleting default oh-my-zsh configs
rm "${HOME}/.oh-my-zsh/lib/bzr.zsh"
rm "${HOME}/.oh-my-zsh/lib/diagnostics.zsh"
rm "${HOME}/.oh-my-zsh/lib/directories.zsh"
rm "${HOME}/.oh-my-zsh/lib/key-bindings.zsh"
echo π΅ Installing Powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${PWD}/zsh/custom/themes/powerlevel10k
echo π΅ Installing other ZSH plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${PWD}/zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/jeffreytse/zsh-vi-mode "${PWD}/zsh/custom/plugins/zsh-vi-mode"
echo π΅ Replacing the default Git Config
ln -sf "${PWD}/git/.gitconfig" "${HOME}"
echo π΅ Configuring Vim
mkdir -p "${HOME}/.vim/undo"
mkdir -p "${HOME}/.vim/backups"
mkdir -p "${HOME}/.vim/swaps"
ln -sf "${PWD}/vim/.vimrc" "${HOME}"
ln -sf "${PWD}/vim/.ideavimrc" "${HOME}"
ln -sf "${PWD}/vim/spell" "${HOME}/.vim/"
echo π΅ Linking misc files
ln -sf "${PWD}/zsh/.zshrc" "${HOME}"
ln -sf "${PWD}/zsh/.zprofile" "${HOME}"
ln -sf "${PWD}/zsh/.p10k.zsh" "${HOME}"
ln -sf "${PWD}/zsh/.screenrc" "${HOME}"
ln -sf "${PWD}/misc/.editorconfig" "${HOME}/site"
sudo mkdir -p "/etc/docker/"
sudo ln "${PWD}/docker/daemon.json" "/etc/docker/"
echo π΅ Hard linking common files from \`code-share\`
ln "${HOME}/site/git/code-share/misc/images/mambo.jpg" "${HOME}/Documents/"
ln "${HOME}/site/git/code-share/misc/images/max_patiiuk_old.jpg" "${HOME}/Documents/"
ln "${HOME}/site/git/code-share/misc/images/max_patiiuk_1x1.jpg" "${HOME}/Documents/"
ln "${HOME}/site/git/code-share/misc/images/max_patiiuk.jpg" "${HOME}/Documents/"
ln "${HOME}/site/git/code-share/misc/images/wolf.jpg" "${HOME}/Documents/"
echo π΅ Initializing Dir Explorer
(
cd "${HOME}/site/python/dir-explorer"
python -m venv venv
venv/bin/pip install -r requirements.txt
)
echo π΅ Initializing Text Hoarder
(
cd "${HOME}/site/javascript/text-hoarder"
npm i
)
echo π΅ Installing Docker Watcher
(
cd "${HOME}/site/git/specify-tools/docker_container"
python -m venv venv
venv/bin/pip install -r requirements.txt
)
echo π΅ Linking launchctl .plist file
mkdir -p ${HOME}/Library/LaunchAgents/
ln -sf "${PWD}/scripts/uk.patii.max.task.plist" "${HOME}/Library/LaunchAgents/"
echo π΅ Update VS Code Icon
mv "/Applications/Visual Studio Code.app/Contents/Resources/Code.icns" "/Applications/Visual Studio Code.app/Contents/Resources/Code_original.icns"
cp "./vscode/icon.icns" "/Applications/Visual Studio Code.app/Contents/Resources/Code.icns"
echo π΄ \#\#\# Private part \#\#\#
echo π΄ This relies on a private \`maxpatiiuk/private-dotfiles\` repository
echo π΄ You should comment out this part or replace it with your own
echo π΄ private repository
(
cd "${HOME}/site/git/"
git clone https://github.com/maxpatiiuk/private-dotfiles.git
cd private-dotfiles
./install.sh
)