This repository contains a series of automated customizations that help me personalize and maintain my Mac. Special thanks to Zack Holman and Dries Vints for inspiring what you see within this repository. In many instances, what I have here is a direct copy of their work.
If you're interested in the philosophy behind why projects like these are awesome, you might want to read the following articles on the subject:
- Dotfiles Are Meant to Be Forked — Zack Holman, Aug 2010
- Getting Started with Dotfiles — Dries Vints, April 2016
The following repositories may provide additional examples from which to draw inspiration.
- dotfiles.github.io — Your unofficial guide to dotfiles on GitHub
- Dries Vints
- Fabio Ivona — Linux-focused for those managing servers
- Freek Van der Herten's
- Mathias Bynens
- Matt Stauffer
- Michael Dyrynda
- Zach Holman
When migrating from an existing machine to another or setting up an additional computer that will match the setup of another, you will want to ensure you have a fresh backup of all of your data and settings.
- Commit and push any pending changes within local git repositories
- Move any important documents into cloud-based storage
- Save all of your work within apps that do not sync to the cloud
- Update your mackup to the latest version and run
mackup backup -f
If you are setting up a new machine, odds are macOS is already up-to-date. However, check System Settings on the new machine and install any pending updates.
We install several software applications via the Mac App Store CLI, so ensure you are logged in to the App Store.
In recent years, I've been using the 1Password SSH agent to securely store my SSH keys.
- Download 1Password
- Open 1Password
- Open "Settings"
- Select "Developer"
- Enable "Use the SSH Agent"
- Click "Change SSH Config..."
- Select "Edit Automatically"
If you are not a 1Password user, you can run the following command to generate a new public and private SSH key. Once complete, add the key to your GitHub profile.
curl https://raw.githubusercontent.com/dascentral/dotfiles/HEAD/ssh.sh | sh -s "<your-key-name>"Let's go ahead and clone this repository. All scripts within this repository assume ~/.dotfiles as the clone location. You may adjust this as you see fit. However, you will need to update all scripts accordingly.
Note that issuing your first git command will prompt installation of the Xcode Command Line Tools. Go grab a coffee/snack/meal while that download and install takes place.
git clone git@github.com:dascentral/dotfiles.git ~/.dotfilesBefore running the main installation script, we need to knock out a few prerequisites.
I use Homebrew Bundle to install the bulk of the software on a new machine. Before executing the main installation script, create a Brewfile to the root of the repository.
I have placed two samples within config/Brewfile that you may use as a template. You can execute the following command to embrace the sample configuration:
cp config/Brewfile/Brewfile.example ./BrewfileI use the Fira Code font within Cursor and VS Code and have configured the install script to automatically update the application settings accordingly. As a result, I made installation of Fira Code a prerequisite for the full software installation that happens next.
The following script installs and configures most of the software that I use on a new machine.
~/.dotfiles/install.shIf you dig into that installation script, you'll note that it does a few things:
- Installs Homebrew, the Missing Package Manager for macOS (or Linux)
- Executes
brew bundle, which installs the bulk of the software - Ensures Composer is up-to-date and installs all global packages
- Configures Git
- Configures Mackup
- Configures Cursor
- Configures VS Code
- Configures Sublime Text
- Customizes macOS settings
The script is idempotent, so it can be run multiple times without concern.
The bin/ folder of this repository contains a dotfiles script that executes a number of maintenance activities that helps keep the machine up-to-date. I try to run this script on a regular basis. (i.e. weekly)
The .zshrc includes ~/.dotfiles/bin in the system path, so you can run this command from anywhere.
dotfilesGatekeeper is a security feature of macOS. Some of the software installed via the Brewfile is published by what Apple considers "unidentified developers."
You can circumvent the security feature by disabling Gatekeeper.
sudo spctl --master-disableIf you run this command, be sure to only open software from sources that you trust. You can always turn it back on after installing a restricted software application.
sudo spctl --master-enableWhile I have automated many of my macOS system configurations via the .macos file, I still have a number of manual modifications that I make following setup of a new machine. My goal is always to limit the amount of manual work. This article helped me understand how to automate application settings:
https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/
Print all domains
defaults domains | tr ',' '\n'Print settings for a specific app
defaults read [domain]
defaults read com.googlecode.iterm2Print specific key
defaults read [domain] [key]
defaults read com.googlecode.iterm2 PrefsCustomFolderWrite new settingss
defaults read [domain] [key] [type] [value]
defaults write com.apple.Notes NotesContinuousSpellCheckingEnabled -bool true