-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmac-setup.sh
232 lines (168 loc) · 8.42 KB
/
mac-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
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
# Script to Setup a New Mac
# run without downloading:
# curl https://raw.githubusercontent.com/leira-sanchez/mac-setup/master/mac-setup.sh | bash
THEME="steeef"
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
# Check for system update and install
softwareupdate -i -a
###############################################################################
# General #
###############################################################################
# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Disable the crash reporter
defaults write com.apple.CrashReporter DialogType -string "none"
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
###############################################################################
# Dock #
###############################################################################
# Auto-hide the dock
defaults write com.apple.dock autohide -float 1
defaults write com.apple.dock autohide-time-modifier -float 1;
# Wipe all (default) app icons from the Dock
# This is only really useful when setting up a new Mac, or if you don’t use
# the Dock to launch apps
defaults write com.apple.dock persistent-apps -array
# Show only open applications in the Dock
defaults write com.apple.dock static-only -bool true
###############################################################################
# Mail #
###############################################################################
# Copy email addresses as `[email protected]` instead of `Foo Bar <[email protected]>` in Mail.app
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
###############################################################################
# Finder Stuff #
###############################################################################
# Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons
defaults write com.apple.finder QuitMenuItem -bool true
# Finder should show all .files
defaults write com.apple.finder AppleShowAllFiles YES
# Finder should show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Keep folders on top when sorting by name
defaults write com.apple.finder _FXSortFoldersFirst -bool true
# When performing a search, search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
###############################################################################
# Trackpad, mouse, keyboard, Bluetooth accessories, and input #
###############################################################################
# Trackpad: enable tap to click for this user and for the login screen
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# Trackpad: map bottom right corner to right-click
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true
# defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1
defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# enable three finger drag on trackpad
defaults write http://com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerDrag -int 1
defaults write http://com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -int 1
echo "${green}Setting up code folder...${reset}"
mkdir -p ~/code
# Install Brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Add custom aliases
echo "${green}Adding Custom Aliases...${reset}"
touch ~/.oh-my-zsh/custom/aliases.zsh
echo -e "alias gac='git add . && git commit -m'\n alias co='checkout'\n alias ys='yarn start'" >> ~/.oh-my-zsh/custom/aliases.zsh
# Install Xcode command line tools
xcode-select --install
# Node + NPM + Yarn
brew install yarn
echo "installing node (via n-install)"
curl -L https://git.io/n-install | bash
echo "node --version: $(node --version)"
echo "npm --version: $(npm --version)"
echo "${green}Installing NVM...${reset}"
brew install nvm
# echo "${green}Installing mysql...${reset}"
# brew install --cask mysql
# echo "${green}Installing sequel-pro-nightly...${reset}"
# brew install --cask homebrew/cask-versions/sequel-pro-nightly
# Config git username and email
echo "${green}Now we'll setup your name and email for git ${reset}"
echo "What's your name?"
read USER_NAME
git config --global user.name "$USER_NAME"
echo "What's your email?"
read EMAIL_ADDRESS
git config --global user.email $EMAIL_ADDRESS
###############################################################################
# VSCode #
###############################################################################
# Install VS Code and extensions
echo "${green}Installing VSCode...${reset}"
brew install --cask visual-studio-code
echo "${green}Installing VSCode Extensions...${reset}"
code --install-extension formulahendry.auto-rename-tag
code --install-extension Gruntfuggly.todo-tree
code --install-extension eamodio.gitlens
code --install-extension bierner.markdown-preview-github-styles
code --install-extension streetsidesoftware.code-spell-checker
code --install-extension streetsidesoftware.code-spell-checker-spanish
code --install-extension xabikos.javascriptsnippets
code --install-extension ue.alphabetical-sorter
code --install-extension jpoissonnier.vscode-styled-components
code --install-extension dbaeumer.vscode-eslint
code --install-extension esbenp.prettier-vscode
code --install-extension GitHub.vscode-pull-request-github
###############################################################################
# Apps #
###############################################################################
echo "${green}Installing Chrome...${reset}"
brew install --cask google-chrome
echo "${green}Installing Alfred...${reset}"
brew install --cask alfred
# echo "${green}Installing appcleaner...${reset}"
# brew install --cask appcleaner
echo "${green}Installing slack...${reset}"
brew install --cask slack
echo "${green}Installing spotify...${reset}"
brew install --cask spotify
echo "${green}Installing postman...${reset}"
brew install --cask postman
echo "${green}Installing zoom...${reset}"
brew install zoom
echo "${green}Installing rectangle...${reset}"
brew install --cask rectangle
# echo "${green}Installing postico...${reset}"
# brew install --cask postico
# echo "${green}Installing whatsapp...${reset}"
# brew install --cask whatsapp
# echo "${green}Installing kindle...${reset}"
# brew install --cask kindle
# echo "${green}Installing send-to-kindle...${reset}"
# brew install --cask send-to-kindle
echo "${green}Installing clipy...${reset}"
brew install --cask clipy
echo "${green}Installing notion...${reset}"
brew install --cask notion
echo "${green}Installing Firefox Developer Edition...${reset}"
brew install --cask firefox-developer-edition
echo "${green}Installing MeetingBar...${reset}"
brew install --cask meetingbar
echo "${green}Installing Tuple...${reset}"
brew install --cask tuple
echo "${green}Installing CoScreen...${reset}"
brew install --cask coscreen
echo "${green}Installing Loom...${reset}"
brew install --cask loom
echo "${green}Installing Loom...${reset}"
brew install --cask docker
echo "${green}Installing Gifski...${reset}"
brew install gifski
echo "${green}Installing App Store CLI...${reset}"
brew install mas
echo "${green}Installing Xcode...${reset}"
# Install XCode from the App Store using its identifier
mas install 497799835
#Done
echo "${green}\n\Done! 🎉 You might need to log out and in or even restart for changes to take effect."