Skip to content

anicoll/mac-bootstrap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Mac Bootstrap

NOTE: Forked from here

These are quite customised from the original and I would recommend you do the same rather than blindly using them

I've removed a few things including tmux.

Original Description

The purpose of this script is to provision a new machine running a fresh install of macOS. It installs and configures the software, dotfiles, and general preference I use for Ruby-based web development. The command line environment is based on Zsh (via Oh-My-Zsh), Vim and Tmux running in iTerm2.

The bootstrap script is very specific to the Mac platform. It has been successfully tested on the following versions of macOS:

  • Yosemite (10.10)
  • El Capitan (10.11)
  • Sierra (10.12)

Prerequisites

Make sure your software is up to date:

sudo softwareupdate -i -a

Install Apple's command line tools:

xcode-select --install

Reboot, check for additional updates, then reinstall, reboot if needed.

sudo softwareupdate -l
sudo softwareupdate -i -a

Sign in to your iCloud account: System Preferences > iCloud. (If you don't sign in before running the bootstrap script, mas-cli will not be able to install apps from the Mac App Store.)

Installation

To install with a one-liner, run this:

curl --remote-name https://raw.githubusercontent.com/joshukraine/mac-bootstrap/master/bootstrap && sh bootstrap 2>&1 | tee ~/bootstrap.log

Want to read through the script first?

curl --remote-name https://raw.githubusercontent.com/joshukraine/mac-bootstrap/master/bootstrap
less bootstrap
sh bootstrap 2>&1 | tee ~/bootstrap.log

WARNING: This script will ask for your admin password multiple times. You'll need to babysit it for a while. :)

What does it do?

When you invoke bootstrap, here's what it does:

NOTE: Previously, I used the bootstrap script to set up many of the standard directories I use in my work. But since I now have Dropbox Plus, all those directories are downloaded automatically after Dropbox is installed. Once they've synced, I symlink them into place in $HOME.

Post-install Tasks

After running bootstrap there are still a few things that need to be done.

  • Restart your machine in order for some changes to take effect.
  • Install software from Mac App Store. (Thank you mas-cli!)
  • Complete Brew Bundle with brew bundle install --global
  • Set up iTerm2 profile (see details below).
  • Add personal data to ~/.gitconfig.local and ~/.zshrc.local.
  • Set up desired macOS keyboard shortcuts (see list below)

Setting up iTerm2

Thanks to a great blog post by Trevor Brown, I learned that you can quickly set up iTerm2 by exporting your profile. Here are the steps.

  1. Open iTerm2.
  2. Select iTerm2 > Preferences.
  3. Under the General tab, check the box labeled "Load preferences from a custom folder or URL:"
  4. Press "Browse" and point it to ~/dotfiles/iterm2/com.googlecode.iterm2.plist.
  5. Restart iTerm2.

macOS Keyboard Shortcuts

These are my (current) primary macOS keyboard shortcuts:

  • Alfred: ⌘Space
  • Spotlight search: ⌘⇧Space
  • Switch input source: ⌃⇧Space
  • Fantastical: ⌥⌘Space
  • OmniFocus: ⌃⌥Space
  • iTerm2 hotkey window: ⌥Space
  • Remap Caps Lock to CTRL (anyone know a way to automate this?)
  • Dash: ⌃⇧K (in hub mode)

How to personalize Mac Bootstrap for your own use.

No one else's development setup will ever be a perfect match for you. That said, if your needs are close enough to mine, you might benefit from using the same shell scripts and overall structure, and just swapping out the particulars with your own. Here's my recommended approach to doing that:

  1. Fork this repo and clone your new fork to your local machine.

  2. Review the 10 steps in bootstrap and make your own customizations. Here's an overview of what's going on:

  • Step 1 (required): Take a look at Laptop and see what you might want to tweak. One of the biggest things is the Brewfile, which you can find in this repo under install/Brewfile. Here you can customize all the packages, casks, and MAS apps that will be installed. Laptop also sets up some basics that are required by the bootstrap script later on.
  • Step 2 (recommended): Use oh-my-zsh?
  • Step 3 (optional): Install NVM?
  • Step 4 (required): The dotfiles. Update the $DOTFILES_* variables (see bootstrap under "Variable declarations") to reference your dotfiles. As a starting point, you can fork mine and then point to your fork.
  • Step 5 (optional): Install fixed-width fonts?
  • Step 6 (optional): Review general macOS settings in install/macos-defaults and adjust as needed. install/macos-dock ensures that the dock contains only the apps you select. Adjust as desired. (NOTE: The macos-dock script depends on the dockutil package installed by Homebrew.)
  1. Create ~/.gitconfig.local and ~/.zshrc.local and add in your personal information. These files are sourced in ~/.gitconfig and ~/.zshrc respectively.

  2. Update the README with your own info, instructions/reminders so you don't forget what you did, and especially the correct install URL:

    curl --remote-name https://raw.githubusercontent.com//mac-bootstrap/master/bootstrap && sh bootstrap 2>&1 | tee ~/boostrap.log

  3. Run the script on your machine and wait for the first error. :) Then fix, commit, push, and repeat.

Some of my favorite dotfile repos

Helpful web resources on dotfiles, et al.

License

Copyright (c) 2016 Joshua Steele. MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 97.6%
  • Ruby 2.4%