-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap
executable file
·112 lines (86 loc) · 3.21 KB
/
bootstrap
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
#!/usr/bin/env bash
set -e
# 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 &
HOSTNAME="gkmbp"
# Set computer name (as done via System Preferences → Sharing)
sudo scutil --set ComputerName "${HOSTNAME}"
sudo scutil --set HostName "${HOSTNAME}"
sudo scutil --set LocalHostName "${HOSTNAME}"
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "${HOSTNAME}"
#
# Do not prompt admins for sudo password and add current user to admins
#
echo '%admin ALL = (ALL) NOPASSWD:ALL' | sudo tee -a /private/etc/sudoers.d/admin
sudo dseditgroup -o edit -a "${USER}" -t user admin
#
# Dock
#
# Autohide
defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
defaults write com.apple.dock show-recents -bool false
# Icon size
defaults write com.apple.dock tilesize -int 50
# Clear out all apps from Dock
defaults write com.apple.dock persistent-apps -array
# Minimize windows into their application’s icon
defaults write com.apple.dock minimize-to-application -bool true
# Speed up Mission Control animations
defaults write com.apple.dock expose-animation-duration -float 0.1
# Restart Dock
killall Dock
#
# Finder
#
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# Show the ~/Library folder
chflags nohidden ~/Library
# Show the /Volumes folder
sudo chflags nohidden /Volumes
# Install Command Line Tools for Xcode
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
sudo softwareupdate -ai
rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
# Yep
mkdir -p ~/.ssh
cat > ~/.ssh/config <<-EOF
AddKeysToAgent yes
ForwardAgent yes
IdentityFile ~/.ssh/id_rsa
LogLevel ERROR
StrictHostKeyChecking no
UseKeyChain yes
UserKnownHostsfile /dev/null
EOF
ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/Secrets/id_rsa ~/.ssh/id_rsa
chmod 0600 ~/.ssh/id_rsa
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
# vim-plug
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# tpm
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Clone down dots
git clone [email protected]:gkze/setup.git ~/.dots
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
(cd ~/.dots && brew bundle)
ln -s ~/.dots/.zshrc ~
ln -s ~/.dots/.zshenv ~
ln -s ~/.dots/.tmux.conf ~
mkdir -p ~/.config
ln -s ~/.dots/nvim ~/.config/nvim
ln -s ~/.dots/powerline ~/.config/powerline
pip3 install -U powerline-status neovim
nvim +PlugInstall +UpdateRemotePlugins +qall
echo 'PATH=/usr/local/bin:$PATH /usr/local/bin/tmux' > /usr/local/bin/tmux-helper
chmod +x /usr/local/bin/tmux-helper