-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·121 lines (102 loc) · 2.97 KB
/
bootstrap.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
#!/bin/bash
# Inspiration
# - https://gist.github.com/codeinthehole/26b37efa67041e1307db#file-osx_bootstrap-sh
# - https://gist.github.com/jexchan/5754956
echo "Starting bootstrapping"
# Check for Homebrew, install if we don't have it
if [[ ! $(which brew) ]]; then
echo "Installing homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew update
# Install Bash 4
brew install bash
PACKAGES=(
automake
fd
fzf
gettext
git
jq
markdown
neovim
npm
pkg-config
python
python3
pypy
ripgrep
the_silver_searcher
tree
universal-ctags
vim
watch
wget
zsh
zsh-syntax-highlighting
flux
google-chrome
google-drive
gpgtools
rectangle
)
echo "Installing packages..."
brew install "${PACKAGES[@]}"
echo "Cleaning up..."
brew cleanup
OMZDIR="$HOME/.oh-my-zsh"
if [[ ! -d "$OMZDIR" ]]; then
echo 'Installing oh-my-zsh...'
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
echo "Configuring ZSH"
echo "================================"
ZSH_CUSTOM="${OMZDIR}/custom"
for config in "$(pwd)"/zsh/**/*.zsh; do
[[ -e "$config" ]] || continue
echo "Adding $(basename -- $config)"
ln -sv "$config" "$ZSH_CUSTOM"
done
echo "Setting up iTerm"
echo "================================"
echo "Creating zshrc symlink..."
ln -sv "$(pwd)/zsh/zshrc" "${HOME}/.zshrc"
echo "Adding profiles..."
ln -sv "$(pwd)/iterm/profiles.json" "${HOME}/Library/Application\ Support/iTerm2/DynamicProfiles/"
echo "Setting up remaining config files..."
[[ ! -d "${HOME}/.config/nvim" ]] && mkdir -p "${HOME}/.config/nvim"
ln -sv "$(pwd)/nvim" "${HOME}/.config"
ln -sv "$(pwd)/vim/vintrc.yml" "${HOME}/.vintrc.yml"
ln -sv "$(pwd)/git/gitconfig" "${HOME}/.gitconfig"
ln -sv "$(pwd)/git/gitignore_global" "${HOME}/.gitignore_global"
[[ ! -d "${HOME}/.k8s" ]] && mkdir -p "${HOME}/.k8s"
ln -sv "$(pwd)/k8s/templates" "${HOME}/.k8s"
# PYTHON PACKAGES
echo "Installing Python packages..."
PYTHON_PACKAGES=(
neovim
pynvim
virtualenv
)
sudo pip install "${PYTHON_PACKAGES[@]}"
echo "Configuring OSX"
echo "================================"
echo "Enabling tap-to-click..."
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
echo "Disabling 'natural' scroll..."
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
echo "Setting Dock to auto-hide and removing the auto-hiding delay..."
defaults write com.apple.dock autohide -bool true
defaults write com.apple.Dock autohide-delay -float 0
defaults write com.apple.dock magnification -bool NO
echo "Set fast key repeat rate"
defaults write NSGlobalDomain KeyRepeat -int 0
# map caps lock to control
# Change default shell
if [[ "$0" != "-zsh" ]]; then
echo 'Changing default shell to zsh...'
chsh -s /bin/zsh
else
echo 'Already using zsh'
fi