-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathgo_go_mac
More file actions
159 lines (119 loc) · 6.32 KB
/
Copy pathgo_go_mac
File metadata and controls
159 lines (119 loc) · 6.32 KB
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
#!/usr/bin/env bash
# Inspired from: ~/.macos — https://mths.be/macos
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
echo "Hello $(whoami)! Let's get you set up."
echo "mkdir -p ${HOME}/projects"
mkdir -p "${HOME}/projects"
echo "installing homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "brew installing stuff"
# ripgrep: rg is faster than alternatives
# imagemagick: eventually I will need this for something
# tree: really handy for listing out directories in text
# bat: A cat(1) clone with syntax highlighting and Git integration.
# z: Jump around directories
brew install git ripgrep imagemagick tree bat wget z
echo "installing node (via nvm)"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash && . ~/.bash_profile
nvm install node
echo "node --version: $(node --version)"
echo "npm --version: $(npm --version)"
echo "installing a few global npm packages"
npm install --global tldr eslint
echo "Installing Java via Jabba"
curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash && . ~/.jabba/jabba.sh
jabba install openjdk@1.11-0
echo "java --version: $(java --version)"
echo "installing apps with brew cask"
brew install --cask alfred google-chrome visual-studio-code vlc discord zoom spotify slack iterm2 docker httpie htop
echo "installing aws client"
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
echo "Setup Git"
wget -O $HOME/.gitconfig https://raw.githubusercontent.com/joejag/dotfiles/main/.gitconfig
echo "cleaning up files"
rm -rf awscli-bundle awscli-bundle.zip
echo "making system modifications:"
###############################################################################
# VS Code #
###############################################################################
code --install-extension dbaeumer.vscode-eslint
code --install-extension esbenp.prettier-vscode
code --install-extension formulahendry.auto-rename-tag
mkdir -p "$HOME/Library/Application Support/Code/User"
wget -O "$HOME/Library/Application Support/Code/User/settings.json" https://raw.githubusercontent.com/joejag/dotfiles/main/vscode-settings.json
###############################################################################
# General UI/UX #
###############################################################################
# Set standby delay to 24 hours (default is 1 hour)
sudo pmset -a standbydelay 86400
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# Save to disk (not to iCloud) by default
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# 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"
# Reveal IP address, hostname, OS version, etc. when clicking the clock
# in the login window
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
# Never go into computer sleep mode
sudo systemsetup -setcomputersleep Off > /dev/null
###############################################################################
# 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
# Make Chrome Two finger swipe for back and forward
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool TRUE
###############################################################################
# Screen #
###############################################################################
# Save screenshots to the desktop
defaults write com.apple.screencapture location -string "${HOME}/Desktop"
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture type -string "png"
###############################################################################
# Dock, Dashboard, and hot corners #
###############################################################################
# Show only open applications in the Dock
defaults write com.apple.dock static-only -bool true
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
###############################################################################
# Kill affected applications #
###############################################################################
for app in "Activity Monitor" \
"Address Book" \
"Calendar" \
"cfprefsd" \
"Contacts" \
"Dock" \
"Finder" \
"Mail" \
"Messages" \
"Photos" \
"Safari" \
"SystemUIServer" \
"iCal"; do
killall "${app}" &> /dev/null
done
###############################################################################
# Zsh #
###############################################################################
echo "Install oh my zsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo "Setup zsh preferences"
wget -O $HOME/.zshrc https://raw.githubusercontent.com/joejag/dotfiles/main/.zshrc
echo "Done. Note that some of these changes require a logout/restart to take effect."