othyn / macos-auto-clicker

A simple auto clicker for macOS Big Sur, Monterey, Ventura and Sonoma.
MIT License
208 stars 24 forks source link

As a user, I would like the application preferences stored to a file so I can back it up #38

Closed othyn closed 2 years ago

othyn commented 2 years ago

At the moment I'm just using the Defaults package to store entities to user defaults, as it was easy and had native Combine support so reactivity and automatic storage to disk was handled as the defined objects were updated.

However, I love to backup preferences for applications I used to git or other such scripts via symlinks and such, it just generally makes it easier if the source of truth for applications was stores somewhere that you can backup.

This is just for me to implement that, removing the Defaults library and replacing it with an alternative that stores to disk. At the moment the simplest way would probably be JSON as you can conform the class to Codable and have some sort of PrefStoreService that handles saving things to disk in place of Defaults. There may also be a library that handles this with Combine support for SwiftUI.

othyn commented 2 years ago

Quick win, just update docs on how to backup user defaults file.