Skip to content

Instantly share code, notes, and snippets.

@hu13
Forked from chris-sev/setup.sh
Created November 20, 2021 19:16
Show Gist options
  • Select an option

  • Save hu13/bf782a0c6de56943cee0251b24e921d0 to your computer and use it in GitHub Desktop.

Select an option

Save hu13/bf782a0c6de56943cee0251b24e921d0 to your computer and use it in GitHub Desktop.
Mac Setup
# how to run this thingy
# create a file on your mac called setup.sh
# run it from terminal with: sh setup.sh
# heavily inspired by https://twitter.com/damcclean
# https://github.com/damcclean/dotfiles/blob/master/install.sh
#!/bin/bash
set -euo pipefail
# Display message 'Setting up your Mac...'
echo "Setting up your Mac..."
sudo -v
# Homebrew - Installation
echo "Installing Homebrew"
if test ! $(which brew); then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
# Install Homebrew Packages
cd ~
echo "Installing Homebrew packages"
homebrew_packages=(
"git"
"node"
"n"
"zsh"
"zsh-completions"
"zsh-autosuggestions"
"zsh-syntax-highlighting"
)
for homebrew_package in "${homebrew_packages[@]}"; do
brew install "$homebrew_package"
done
# Install Casks
echo "Installing Homebrew cask packages"
homebrew_cask_packages=(
"adobe-creative-cloud"
"discord"
"google-chrome"
"iterm2"
"keycastr"
"loopback"
"notion"
"raycast"
"screenflow"
"setapp"
"spotify"
"tableplus"
"visual-studio-code"
)
# extra apps to install
# uad for apollo twin x
# logi options
# descript
# elgato control center
# elgato stream deck
# apps in mac store
# amphetamine
# easyres
# fantastical
# apps in setapp (check your setapps favorites list)
# bartender
# sip (color picker)
# yoink
# cleanshot
# cleanmymac
# install n (https://github.com/tj/n)
# make sure you follow steps here to take control of /usr folders
# configure npm permissions to current user
# http://npm.github.io/installation-setup-docs/installing/a-note-on-permissions.html
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
for homebrew_cask_package in "${homebrew_cask_packages[@]}"; do
brew install --cask "$homebrew_cask_package"
done
# configure git
git config --global user.name "Chris Sev"
git config --global user.email "chris@better.dev"
gh config set git_protocol "ssh"
# Create projects directory called batcave
echo "Creating a Batcave directory"
mkdir -p $HOME/documents/batcave
# zsh and oh-my-zsh
echo "Adding ZSH"
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/agkozak/zsh-z $ZSH_CUSTOM/plugins/zsh-z
# zsh configuration
touch ~/.my-zshrc
# aliases
echo "alias ni='npm i'" >> ~/.my-zshrc
echo "alias ns='npm start'" >> ~/.my-zshrc
echo "alias nb='npm run build'" >> ~/.my-zshrc
echo "alias nd='npm run dev'" >> ~/.my-zshrc
# zsh plugins
echo "plugins=(git zsh-completions zsh-z)" >> ~/.my-zshrc
echo "source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ~/.my-zshrc
echo "source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.my-zshrc
# add our zshrc config to the main zshrc config
echo ". ~/.my-zshrc" >> "$HOME/.zshrc"
# Generate SSH key
echo "Generating SSH keys"
ssh-keygen -t rsa
echo "Copied SSH key to clipboard - You can now add it to Github"
pbcopy < ~/.ssh/id_rsa.pub
# Complete
echo "Installation Complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment