-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.sh
executable file
·109 lines (82 loc) · 3.53 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
#!/usr/bin/env bash
# ----------------------------------------------------------------------------
# bootstrap.sh - f'ng <[email protected]> https://justfielding.com
#----------------------------------------------------------------------------
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until script has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Set the timezone!
sudo systemsetup -settimezone "America/Chicago" > /dev/null
default_hostname=$(hostname)
read -p "Hostname (default: $default_hostname): " hostname
hostname=${hostname:-$default_hostname}
# Set ComputerName, HostName, and LocalHostName
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"
# Check for Homebrew and install it if missing
if test ! $(which brew)
then
echo "Installing Homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew update
brew tap homebrew/bundle
brew install zsh stow mas python3 node rbenv ruby-build
latest_ruby=$(rbenv install -l | grep -v - | tail -1)
rbenv install $latest_ruby
rbenv global $latest_ruby
rbenv rehash
tic ~/.terminfo/69/iterm.terminfo
tic ~/.terminfo/74/tmux.terminfo
tic ~/.terminfo/74/tmux-256color.terminfo
# install neovim plugins
npm install -g neovim
pip install neovim
pip3 install neovim
gem install neovim
# Remove all of whatever that is in the dock and then restart dock
defaults write com.apple.dock persistent-apps -array && killall Dock
# Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Use current directory as default search scope in Finder
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Show the ~/Library folder
chflags nohidden ~/Library
# iterm2 - scroll less output
defaults write com.googlecode.iterm2 AlternateMouseScroll -bool true
# Finder Fun!
# Finder: show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# Finder: show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Finder: show full POSIX path in title bar
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Finder: show hidden files by default
defaults write com.apple.finder AppleShowAllFiles -bool true
# Automatically hide and show menu bar
defaults write NSGlobalDomain _HIHideMenuBar -bool true
# Restart Finder
killall Finder
# set default shell to zsh
sudo dscl . -create /Users/$USER UserShell /usr/local/bin/zsh
brew bundle --file=./homebrew/.Brewfile
## ACTIONS NEEDED
### zsh plugins not installed, zplug will warn about it at shell startup and
### ask to install them. I would like to explicitly invoke this after zplug is
### installed from the .Brewfile.
### The following might do this. Test and confirm.
zplug install
nvim +PlugInstall +qall
# ADD MESSAGE ABOUT ACCESSIBILITY API and restarting the services below
brew services start koekeishiya/formulae/skhd
brew services start koekeishiya/formulae/yabai
## initialize locate database
sudo launchctrl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
# set iterm2 color profile
open ~/.vim/plugged/vice/vice.itermcolors
echo -e "\033]50;SetProfile=vice\a"