forked from chrisdail/mac-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·94 lines (74 loc) · 2.24 KB
/
setup
File metadata and controls
executable file
·94 lines (74 loc) · 2.24 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
#!/bin/bash
DIR=$( cd "$( dirname "$0" )" && pwd )
DOTFILES=$DIR/dotfiles
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"
fi
# Change shell to fish
chsh -s /usr/local/bin/fish
mkdir ~/bin
}
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
killall Dock
killall Finder /System/Library/CoreServices/Finder.app
}
dotfiles
updateBrew
brewBundle
iTermConfig
fish
osxDefaults