Back to projects

macOS Automation

Bash scripts to automate a fresh install of macOS

MacOS Automated Setup

Opinionated automation shell scripts to set up macOS.

  • Installs Homebrew.
  • Restores the current backup:
    • Symlinks dotfiles from the repo to the home folder (.config/ and .zshrc).
    • Installs packages listed in a Brewfile using brew and mas (for App Store apps).
  • Changes some macOS default preferences; see the full list here.

Automated setup

CAUTION: This will overwrite your dotfiles. If you want to use this project with your own backup read this first.

Check dependencies:

Terminal window
git -v

Start:

Terminal window
git clone https://github.com/Jaycedam/mac-setup.git ~/Developer/mac-setup
cd ~/Developer/mac-setup && sh main.sh

Manual settings

Some settings must be changed manually due to API limitation or lack of documentation. Check this issue for more details.


How to use

If you want to use this project with your own dotfiles and configs, just follow these instructions:

IMPORTANT: The path ~/Developer/mac-setup is expected by the script; it’s used to generate symlinks and relative path operations.

  1. Fork the project then git clone (Replace USERNAME with yours):
Terminal window
git clone https://github.com/USERNAME/mac-setup.git ~/Developer/mac-setup
  1. Delete my backup:
Terminal window
cd ~/Developer/mac-setup && rm -rf dotfiles/*
  1. Back up your dotfiles and Brew packages. This moves your dotfiles to the project directory, then creates symlinks to $HOME. It will also back up your Brew packages into a Brewfile:
Terminal window
cd ~/Developer/mac-setup && sh backup.sh

If you install new Brew packages, just run backup.sh again to update the Brewfile.

  1. Make sure to change the USERNAME from the url in the automated setup section to yours. Then push the changes to your repo.