Mac Setup Script

Jan 15, 2018 00:50 · 253 words · 2 minute read OSX Automation

This is the scrip I use to setup my mac after a fresh reformat. You can create a file anywhere, copy the contents, and then make the script executable with chmod +x script.sh and use it to setup your mac as well!

#!/bin/bash

# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
  echo "Installing homebrew..."
  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi

# Run Doctor
brew doctor

# Update homebrew recipes
brew update

# Install GNU core utilities (those that come with OS X are outdated)
brew install coreutils

# Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
brew install findutils

# Install Bash 4
brew install bash

# Updated Grep
brew tap homebrew/dupes
# Caskroom fonts
brew tap caskroom/fonts

# Install Brew binaries
binaries=(
  zsh
  zsh-completions
  git
  tmux
  python3
  ssh-copy-id
  vim
  ack
  m-cli
  mas
  ctop
  cmus
  ranger
  homebrew/dupes/grep
)
brew install ${binaries[@]}
brew install reattach-to-user-namespace --wrap-pbcopy-and-pbpaste  #Tmux copy

# Install brew cask
brew install caskroom/cask/brew-cask

# Install Brew Apps
apps=(
  google-chrome
  iterm2
  sequel-pro
  dropbox
  firefox
  spotify
  transmission
  skitch
  vlc
  alfred
  sizeup
  flux
  flash-npapi
  franz
  nordvpn
  docker
  franz
  font-bitstreamverasansmono-nerd-font
)

# Install apps to /Applications
# Default is: /Users/$user/Applications
echo "installing apps..."
brew cask install --appdir="/Applications" ${apps[@]}

# Install apps from app store using mas
mas install 634148309 # Logic Pro X
mas install 430798174 # Haze over
mas install 803453959 # Slack
mas install 409203825 # Mac Numbers (Spreadsheets)
mas install 409201541 # Mac Pages (Docs)

# Python packages
pip3 install tmuxp
pip3 install cookiecutter