Syncing the config in Git

I found three preferences files in ~/Library/Preferences for BTT, and I'd like to sync them with Git. However, when I convert them to XML format, BTT switches them back to binary.

Before I write a script that copies the preferences to another folder, convert, push/pull, copy back, I was wonder if there was a better way?

(There were two other posts about this, but no replies.)

Thanks!!

1 Like

I don't think you'll be happy syncing BTT with git.

BTT uses sqlite databases, various files and the standard macOS user defaults system (which is what you are referring to). It names its files after the current version (for being able to downgrade), which also makes using git for this pretty hard. The formats of the files can't be changed.

These are the relevant folders/files:
~/Library/Application Support/BetterTouchTool
~/Library/Preferences/com.hegenberg.BetterTouchTool.plist

Ah, that makes sense. I found another post about exporting the presets, that's probably going to be a better way to go. :smile:

yep, that should work better.
You can also automatically load & override a preset on launch. By default it's using ~/.btt_autoload_preset.json, this can be overridden via defaults write com.hegenberg.BetterTouchTool BTTAutoLoadPath "~/somepath"

Has this path / option name changed recently? I have been trying to get it working with defaults write as mentioned or symlinking the default path you mentioned to a preset, but it appears to have no effect when I restart BTT (changes in my preset file don't appear to be reflected in BTT configuration UI).

I couldn't find any documentation about the autoloading except in this issue, so just wondering — maybe it's not a truly supported feature?

no, that is still the same. Make sure to execute the defaults command while BTT is quit

Ah, that was the key! I still had BTT running and it didn't take effect, but after a quit the new path I set seems to be working. Thank you!