3

Is there a way for me to export my system preferences on my Mac for quick install on another machine?

An example of what I am trying to accomplish is, when I start a new job, I would like to import my settings and have my system preference work without having to manually configure all of my custom settings.

I am most interested in exporting settings for :

  • Trackpad / Mouse
  • Keyboard
  • Dock
  • dashboard (I like to disable it)
  • What system preference exactly are you trying to export? It is needed so I can provide the code necessary for a quick install – TheBro21 May 11 '15 at 21:51
  • I will be updating my answer adding more due to the fact that I don't have time ;) For now, I put the mouse/trackpad – TheBro21 May 12 '15 at 6:50
  • Ok I finished the full answer. I am at my iPad though. So make sure to dheck if for example com.apple.preference.mouse is correct by doing the ls command. Once you have done the script, you can save it as application and double click anywhere and it will install. – TheBro21 May 12 '15 at 7:14
  • Changed the answer fully, because it was all wrong, and all the preferences are withouth the ....preference.... in the name. – TheBro21 May 12 '15 at 13:43
1

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

3

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.

  • Interesting. defaults (ex|im)port seems to be an undocumented feature (at least in the official defaults manpage; it's documented online by other people) – nloveladyallen Feb 9 at 16:46
1

If you cannot find an app/applet that does this, you might need to hack it yourself through Terminal. Take Bluetooth Trackpad for example:

Run:

defaults read com.apple.driver.AppleBluetoothMultitouch.trackpad

I get:

{
    Clicking = 0;
    DragLock = 0;
    Dragging = 0;
    TrackpadCornerSecondaryClick = 0;
    TrackpadFiveFingerPinchGesture = 2;
    TrackpadFourFingerHorizSwipeGesture = 2;
    TrackpadFourFingerPinchGesture = 2;
    TrackpadFourFingerVertSwipeGesture = 2;
    TrackpadHandResting = 1;
    TrackpadHorizScroll = 1;
    TrackpadMomentumScroll = 1;
    TrackpadPinch = 1;
    TrackpadRightClick = 1;
    TrackpadRotate = 1;
    TrackpadScroll = 1;
    TrackpadThreeFingerDrag = 0;
    TrackpadThreeFingerHorizSwipeGesture = 2;
    TrackpadThreeFingerTapGesture = 2;
    TrackpadThreeFingerVertSwipeGesture = 2;
    TrackpadTwoFingerDoubleTapGesture = 1;
    TrackpadTwoFingerFromRightEdgeSwipeGesture = 3;
    USBMouseStopsTrackpad = 0;
    UserPreferences = 1;
    version = 5;
}

These are my settings for external trackpad. You get find the same results by opening

~/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.plist

but simply copying and pasting the .plist file to a new computer doesn't change the settings. You have to use import (and export) options.

defaults export com.apple.AppleMultitouchTrackpad ~/Desktop/Test.plist

Move Test.plist to the new computer, and:

defaults import com.apple.AppleMultitouchTrackpad ~/Desktop/Test.plist
1

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

Peace! ✌️

0

There's not exactly an export function. You can find (most) preferences in the library. If you hold alt/option and select "Go To" in the Finder menu bar, you can open the user library. There's a folder named preferences which contains the corresponding files. Named like com.apple.xy.plist, where xy is 'dock' for example.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .