-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup
executable file
·144 lines (116 loc) · 3.55 KB
/
setup
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
#!/bin/bash
DIR=$( cd "$( dirname "$0" )" && pwd )
DOTFILES=$DIR/dotfiles
xcode() {
xcode-select --install
}
linked() {
ln -shf "$DOTFILES/$1" "$HOME/$1"
}
dotfiles() {
echo Linking all dotfiles to home directory
linked .vimrc
linked .vim
linked .gitconfig
linked .tmux.conf
mkdir -p ~/.config/fish/functions
linked .config/fish/config.fish
linked .config/fish/functions/fish_prompt.fish
mkdir -p ~/Library/Application\ Support/Code/User
linked "Library/Application Support/Code/User/settings.json"
linked "Library/Application Support/Code/User/keybindings.json"
mkdir -p ~/.ssh
linked .ssh/config
}
updateBrew() {
which brew
if [ $? -ne 0 ] ; then
echo Installing Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
echo Updating Homebrew
brew update
brew upgrade
}
brewBundle() {
echo Installing packages from Brewfile
brew bundle --verbose
}
iTermConfig() {
# Specify the preferences directory
defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "$DIR/dotfiles/iTerm2"
# Tell iTerm2 to use the custom preferences in the directory
defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true
}
fish() {
echo Setting shell to fish
# Add fish to shells
grep fish /etc/shells
if [ $? -ne 0 ]; then
#sudo sh -c "echo /usr/local/bin/fish >> /etc/shells"
sudo sh -c "echo /opt/homebrew/bin/fish >> /etc/shells"
fi
# Change shell to fish
#chsh -s /usr/local/bin/fish
chsh -s /opt/homebrew/bin/fish
mkdir ~/bin
}
nvm() {
# Install bass
fisher install edc/bass
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
linked .config/fish/functions/nvm.fish
}
codeExtensions() {
echo Installing VS Code Extensions
code --install-extension hashicorp.terraform
code --install-extension ms-azuretools.vscode-docker
code --install-extension ms-python.python
code --install-extension ms-python.vscode-pylance
code --install-extension wholroyd.jinja
code --install-extension golang.go
code --install-extension octref.vetur
code --install-extension slevesque.vscode-hexdump
}
typr() {
echo Installing Typr
if [ ! -d ~/Applications/Typr.app ]; then
mkdir ~/Applications
(cd ~/Applications && wget https://github.com/chrisdail/typr/releases/download/v0.2/Typr.zip && unzip Typr.zip && rm Typr.zip)
fi
}
osxDefaults() {
echo Mac OS Defaults
# Key repeat Interval
defaults write -g InitialKeyRepeat -int 15 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
# Show all files
defaults write com.apple.finder AppleShowAllFiles YES
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Unnatural scrolling
defaults write -g com.apple.swipescrolldirection -bool false
# Remove all unwanted apps from the dock
defaults delete com.apple.dock persistent-apps
defaults delete com.apple.dock persistent-others
# Bluetooth audio
defaults write bluetoothaudiod "Enable AAC codec" -bool true
killall Dock
killall Finder /System/Library/CoreServices/Finder.app
}
watchPam() {
echo Enabling Apple Watch via PAM
sudo cp misc/pam.d_sudo /etc/pam.d/sudo
}
xcode
dotfiles
updateBrew
brewBundle
iTermConfig
fish
nvm
codeExtensions
osxDefaults
watchPam
# Note: If you clone my repo, you probably want to comment this out
typr