Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 162 lines (125 sloc) 3.8 KB
#!/bin/bash
set -euo pipefail
# ==================================================================
# ROOT
# ==================================================================
cd ~
mkdir repos
# ==================================================================
# SHELL SCRIPTS
# ==================================================================
echo "Cloning shell scripts"
cd ~/repos
git clone https://github.com/trevordmiller/shell-scripts.git
cd ~
# ==================================================================
# DOTFILES
# ==================================================================
echo "Cloning dotfiles"
cd ~/repos
git clone https://github.com/trevordmiller/dotfiles.git
cd dotfiles
./index
cd ~
# ==================================================================
# PACKAGES
# ==================================================================
echo "Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Adding Homebrew taps"
homebrew_taps=(
"universal-ctags/universal-ctags"
"joshuaclayton/formulae"
)
for homebrew_tap in "${homebrew_taps[@]}"; do
brew tap "$homebrew_tap"
done
echo "Installing global Homebrew packages"
homebrew_packages=(
"bash"
"bash-completion"
"shfmt"
"the_silver_searcher"
"tmux"
"reattach-to-user-namespace"
"fzf"
"universal-ctags"
"unused"
"vim"
"git"
"asciinema"
)
for homebrew_package in "${homebrew_packages[@]}"; do
brew install "$homebrew_package"
done
echo "Installing Vim plugin manager"
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo "Installing Vim plugins"
vim +PlugInstall +qall
echo "Creating Vim history file directories"
mkdir ~/.vim/{backup_files,swap_files,undo_files}
echo "Installing Node version manager"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
echo "Installing Node"
. ~/.nvm/nvm.sh
nvm install --lts
nvm use --lts
echo "Upgrading npm"
npm install -g npm
echo "Adding npm user"
npm adduser
# ==================================================================
# APPS / FONTS
# ==================================================================
echo "Installing Homebrew cask apps and fonts"
brew tap caskroom/fonts
homebrew_cask_packages=(
"font-fira-mono"
"iterm2"
"1password"
"rescuetime"
"google-chrome"
"spotify"
)
for homebrew_cask_package in "${homebrew_cask_packages[@]}"; do
brew cask install "$homebrew_cask_package"
done
# ==================================================================
# MACOS
# ==================================================================
# KEYBOARD
echo "Configuring key repeat"
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10
# HIDDEN FILES
echo "Configuring hidden files to show"
defaults write com.apple.finder AppleShowAllFiles YES
killall Finder
# MENU BAR
echo "Configuring menu bar to autohide"
defaults write NSGlobalDomain _HIHideMenuBar -bool true
killall Finder
# DOCK
echo "Configuring dock to autohide"
osascript <<EOD
tell application "System Events"
if (get autohide of dock preferences) is false then
tell dock preferences to set autohide to not autohide
end if
end tell
EOD
# SCREENSHOTS
echo "Configuring screenshots to save in Downloads"
defaults write com.apple.screencapture location ~/Downloads
killall SystemUIServer
# BLUETOOTH AUDIO
echo "Configuring highest quality bluetooth audio"
sudo defaults write bluetoothaudiod "Enable AAC codec" -bool true
# CHROME
echo "Configuring incognito mode"
defaults write com.google.chrome IncognitoModeAvailability -integer 1
# ==================================================================
# RESTART
# ==================================================================
sudo shutdown -r now