Sync apps preferences between multiple Macs
Open preferences and check the box marked "Load preferences from a customer folder or URL""
You can browse to your Dropbox folder and the click "Save Settings to Folder"
Confirming that Kevin's answer above also works via iCloud Drive sync in High Sierra.
I did the following:
- Create a folder called "Sync" directly in iCloud Drive (as a sibling to Documents)
- Create another folder called iTerm2 within Sync (presumably I will do this with other apps, hence the folder structure)
- Point iTerm2 there via its Preferences. It will ask you if you want to place a current copy of the plist file there.
- Repeat step #3 on all other systems where you want to use iTerm2
Note that there can be some latency with iCloud Drive sync, but it does work.
You could set up a folder action item that monitors the relevant folders and runs an Applescript that copies the relevant preference files to the Dropbox folder when the folder changes.
Another (similar) approach would be writing a launch agent:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.yourname.yourapp</string>
<key>Program</key>
<string>/Users/yourname/path/to/your/script</string>
<key>ProgramArguments</key>
<array>
<string>script</string>
</array>
<key>WatchPaths</key>
<array>
<string>/path/to/preferencefile1.plist</string>
<string>/path/to/preferencefile2.plist</string>
</array>
</dict>
</plist>
Save this as a com.yourname.yourapp.plist file then copy it to ~/Library/LaunchAgents/. Load it in launchd using
launchctl load ~/Library/LaunchAgents/com.yourname.yourapp.plist
start it: launchctl start com.yourname.yourapp
Now the launchd agent will run the script /Users/yourname/path/to/your/script every time "preferencefile1.plist", "preferencefile2.plist", etc, are changed.
For example "script" could be something that copies the preference files to the dropbox folder.
Another launch agent should be set on the other machine to monitor the files in the dropbox folder and copy them to the correct location when they change.