Skip to content

Instantly share code, notes, and snippets.

@Cabeda Cabeda/osx-setup.sh forked from somebox/osx-setup.sh
Last active May 16, 2020

Embed
What would you like to do?
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc).
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Includes many utilities and apps:
# - homebrew, rvm, node, python
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, vscode, postgres, chrome devtools, heroku, awscli, git.
# - team: slack, google drive, keybase
# - utils: unarchiver, caffeine
# - productivity: notion authy
# Settings
node_version="10.15.3"
ruby_versions="2.6.3"
python="3.7.4"
ruby_default="2.6.3"
# helpers
function echo_ok { echo -e '\033[1;32m'"$1"'\033[0m'; }
function echo_warn { echo -e '\033[1;33m'"$1"'\033[0m'; }
function echo_error { echo -e '\033[1;31mERROR: '"$1"'\033[0m'; }
echo_ok "Install starting. You may be asked for your password (for sudo)."
# requires xcode and tools!
xcode-select -p || exit "XCode must be installed! (use the app store)"
# requirements
cd ~
mkdir -p tmp
echo_warn "setting permissions..."
for dir in "/usr/local /usr/local/bin /usr/local/include /usr/local/lib /usr/local/share"; do
sudo chgrp admin $dir
sudo chmod g+w $dir
done
# homebrew
export HOMEBREW_CASK_OPTS="--appdir=/Applications"
if hash brew &> /dev/null; then
echo_ok "Homebrew already installed"
else
echo_warn "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# RVM
if hash rvm &> /dev/null; then
echo_ok "RVM already installed"
else
echo "Installing RVM..."
curl -sSL https://get.rvm.io | bash -s stable --ruby
fi
# add default gems to rvm
global_gems_config="$HOME/.rvm/gemsets/global.gems"
default_gems="bundler awesome-print lunchy rak"
for gem in $default_gems; do
echo $gem >> $global_gems_config
done
awk '!a[$0]++' $global_gems_config > /tmp/global.tmp
mv /tmp/global.tmp $global_gems_config
# RVM ruby versions
for version in $ruby_versions; do
rvm install $version
done
# moar homebrew...
brew install caskroom/cask/brew-cask
brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup
# brew taps
brew tap homebrew/cask-versions
brew tap homebrew/cask-fonts
brew tap teamookla/speedtest
brew tap xo/xo
# Homebrew base
brew upgrade
brew install \
autoconf automake bash-completion go gpg freetype htop-osx \
jq libxml2 node python heroku terraform tfswitch\
postgres sqlite unrar v8 wget pipenv poetry git ripgrep\
awscli asdf speedtest rust starship bitwarden-cli rclone
# brew cask fonts
# echo_warn "Installing fonts..."
# brew cask install \
# font-anonymous-pro \
# font-dejavu-sans-mono-for-powerline \
# font-droid-sans \
# font-droid-sans-mono font-droid-sans-mono-for-powerline \
# font-meslo-lg font-input \
# font-inconsolata font-inconsolata-for-powerline \
# font-liberation-mono font-liberation-mono-for-powerline \
# font-liberation-sans \
# font-meslo-lg \
# font-nixie-one \
# font-office-code-pro \
# font-pt-mono \
# font-raleway font-roboto \
# font-source-code-pro font-source-code-pro-for-powerline \
# font-source-sans-pro \
# font-ubuntu font-ubuntu-mono-powerline
# brew cask quicklook
# echo_warn "Installing QuickLook Plugins..."
# brew cask install \
# qlcolorcode qlmarkdown qlprettypatch qlstephen \
# qlimagesize \
# quicklook-csv quicklook-json epubquicklook
# Apps
echo_warn "Installing applications..."
# google
brew cask install google-chrome google-drive-file-stream
# other favorites
brew cask install \
caffeine spotify vlc \
iterm2 chrome-devtools firefox visual-studio-code postico dbeaver-community \
slack zoomus keybase \
notion docker tunnelblick spectacle authy \
scroll-reverser clean-me bitwarden-cli
# brew imagemagick
#brew cask install inkscape
brew install librsvg
brew install imagemagick --with-librsvg
# Install my time-tracker
pip install time-tracker
pip install -U Commitizen
echo
echo_ok "Done."
echo
echo "After Dropbox has finished installing, link Sublime Text settings:"
echo
echo "Then go to https://packagecontrol.io/installation for Package Control"
echo
echo "You may want to add the following settings to your .bashrc:"
echo_warn ' export HOMEBREW_CASK_OPTS="--appdir=/Applications"'
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.