2

I am trying to automate the process of setting up a new laptop as much as possible. There are certain changes I always end up making manually on a new Mac, such as enabling screen zooming with the Ctrl modifier and setting up keyboard shortcuts to map ⌘⌥← to "Select Previous Tab" in all applications. I’m sure there is a preferences.write equivalent to do this, but gosh darn it, I have no idea how to determine what it is. Can I somehow monitor or "diff" my preferences after making the change manually, perhaps?

  • ~/Library/Preferences/.GlobalPreferences.plist – Ruskes Sep 19 '18 at 5:10
1

Apple stores most relevant preferences in a database now, so your best bet is to ignore plist files on the filesystem and focus on the output of defaults read com.apple.whatever for the things you change. Unfortunately, there isn't a good Rosetta Stone that says if you are in preference X - look for changes in these seven preference domains. Where Apple stores iCloud or security information doesn't map to each visual icon in system preferences so you'll need to issue more than one defaults read to capture the entire state of most preference panes since most panes write to more than one setting domain.

Alternatively, you could just use MDM and configuration profiles and scripts to make all changes so that you just push the changes to all machines from your management tool and skip the whole reverse engineering process entirely.

In the past MCX was the path to managing enterprise configurations and that's the equivalent of your wanting to look at the .plist files that stored those settings initially at the dawn of OS X - but the current system of configuration profiles, scripted changes and MDM hooks has left MCX and .plist to just the dusty corners that haven't been updated for the new central database to store user and system defaults.

0

If you know the file which is being changed, you can compare the output before/after in the terminal in order to find the exact setting name. For example:

/usr/libexec/PlistBuddy -c Print ~/Library/Preferences/.GlobalPreferences.plist > /tmp/before.txt

And, diff /tmp/before.txt /tmp/after.txt to see the items being changed. But, be careful, because it's likely that the preference you're changing will be buried in the hierarchical structure.

If you don't already know the file which is being changed, then you can monitor the Library/Preferences folder with ls -lFat to see the most recently changed files listed first, and you can probably determine which file you're interested in from there.

You must log in to answer this question.

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