Artboard 16light, inspiration, solution, idea, innovation,Google Sheets iconSwift icon
Published at
Updated at
Reading time
This post is a note that includes my thoughts about something I found online. Check it out yourself!

If you're using a Mac, you might have come across tutorials explaining how to change particular macOS configuration via the command line.

For example, I google and found this command to add a spacer tile to the macOS dock.

defaults write persistent-apps -array-add '{"tile-type"="spacer-tile";}'

These commands can offer functionality that is not available via the GUI. Additionally, they allow users to automate and script their general macOS configuration. When you're setting up a new development machine, an automated setup can save you hours.

These automation scripts are often places in so-called dotfiles projects. These projects include config files such as .gitconfig and .vimrc and scripts that install additional software and configure the operating system.

Have a look at two examples:

The macOS configuration section in Mathias' dotfiles includes 226 (๐Ÿ˜ฒ) of default write commands. That's a lot of automation!

When looking at the public dotfiles, I always wondered how people find the commands to change and save macOS settings. As you've seen in the command above, these operating system settings are not guessable.

Today I read the post Change macOS user preferences via command line post written by Paweล‚ Grzybek, and he shared a nifty approach to discovering the commands and arguments yourself.

It includes a plain old diff of your settings' overall state, but read the post yourself; if you want learn more about automating you macOS setup, this post is worth it.

Related Topics

Related Articles