Apple - How can I export my system preferences?

I wrote some scripts to backup and restore Mac preferences. It does both System and Application preferences.

You can grab them here: https://github.com/clintmod/mac-preferences-backup

They're pretty simple. I just loop over the domains from running defaults domains and then call default export [domain] [plist file path].

Then to restore I just loop over all the plist files in the dir and run default import [plist file path]

You can modify the config.py file if you want to backup to a different dir. The default dir is ~/Dropbox/MacPrefsBackup.


There is no specific way of doing this, but this is how I do it. My setup is redundant but it works the best for me and nothing is ever lost.

TL;DR: Make sure you have homebrew installed. Then run the following.

brew install mackup
mackup backup
brew install clintmod/formulas/macprefs
macprefs backup

But I recommend you read the docs of these two tools

  • Mackup
  • MacPerfs

Peace! ✌️


I updated my answer because all of it was wrong:


You will want to use an applescript for your preference setups. Here is the code for some of them and screenshots of the actual plist so you get an idea of the options possible. IF this does not apply straight away, you might need to restart the computer. Don't forget to save applescript as an Application. NOT script

Trackpad/Mouse

In here, it varies. It is either com.apple.driver.AppleHIDMouse for mouse, com.apple.driver.AppleBluetoothMultitouch.mouse for bluetooth mouse, and com.apple.AppleMultitouchTrackpad for trackpad

tell application "Terminal"
do shell script "defaults write com.apple.AppleHIDMouse Button2 1"
end tell

The example above changes right click to be left click as well

Keyboard

Unfortunately, I could not find a preference for keyboard. I will keep on searching though.

Dock

tell application "Terminal"
do shell script "defaults write com.apple.dock autohide YES"
end tell

This was just an example. Switch autohide with whatever option and YES with value or boolean. Booleans are YES and NO (unlike in scripts "true" "false") I put a picture on the end so you can see all the possible options for all the options.

Disable Dashboard

I also could not find how to. Though it is presumably in com.apple.spaces

Dock options: enter image description here

Mouse: enter image description here

Bluetooth Mouse enter image description here