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 twoother posts about this, but no replies.)
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
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?
Just wanted to share here, in case anyone is going through the same issue, but I've been trying to figure out a way of adding the btt profile to the version control with more legible diffs of the changes being committed.
The main challenge I found when trying to do that is items in BTTPresetContent property are saved in a non-deterministic order every time you export a profile.
I put together a command line using yq that sorts that, and I have that configured in a pre-commit in my dotfiles git repo.
Note: the command will write the file in-place because of the "-i" flag. So make sure to have a backup before running the command, or remove the flag to print it to stdout for validation first.