Sync on custom location / cloud


#1

Hi everybody,
This is my first post, I'm still discovering BetterTouchTool. I have the feeling I can use it to replace 2 or 3 tools I currently use, and get access to new features. Awesome :-).

I have seen in the advanced settings an experimental sync feature, that is meant to sync with dropbox.
I would love to use this sync feature ! But I do not use dropBox, I have a nextCloud instance instead.

Would it be possible to offer one of those two possibilities:

  • save settings in a custom folder, so that the cloud client can sync them to other machines
  • offer a sync option to a webdav server

Thanks a lot for the work, I think BTT will become one of the important utilities for my day to day comfort and productivity ! If so, I'll be more than happy to pay a license for that.


#2

Hi,

I was going to open a thread for exactly the same thing :slight_smile:

What I could imagine is an option to "watch" one or more preset(s):

If the preset is modified locally, auto-export it to this given folder
if the preset file in that folder changes, auto-import it locally

Note: by locally I mean the local instance of BetterTouchTool running on my machine)

I believe that would make it possible to sync presets between computers, regardless of the cloud provider which is used (Google Drive, Onedrive, Dropbox, whatever), as they all work with a local folder which gets synced to the cloud.

It also would be useful for people who only have one machine, as for them it's an auto-backup settings equivalent


#3

That would indeed do the job for my need.
I could point to a file observation class written in swift if that can help: https://github.com/jduquennoy/Log4swift/blob/master/Log4swift/Utilities/FileObserver.swift

Note that it does not use apple's FSEvents, because the idea was to make it easily portable to linux (which did not happen as of today), and because the FSEvent APIs are not easily accessible with swift.


#4

Another vote!

I use iCloud and Resilio to sync. The latter requires a specified folder to sync. I am leary of syncing the BTT folder in App Support as I'm not sure what will happen with user permissions.


#5

I would strongly suggest that "Dropbox" sync support be replaced with a more generic "Sync folder" as suggested above. Two reasons I don't like using integration to cloud sync available in many apps today:

  1. Clutters the cloud drive because you don't have control over where the setting files are put
  2. Leaves many users OOL unless they choose to run multiple sync clients (icch!)

Does anyone know of a workaround such as moving sync files to a different folder and using symlinks to reference it? I know that mucking with what is in Library folder is highly frowned upon but maybe there is a process that someone knows works until a more generic sync solution can be found.

Note: For a tool like BTT, not having sync is a major drawback if you have more than one computer.


#6

Gonna answer my own question here... I found that you can write a BTT action that will copy presets to a common folder (i.e. one that is sync'ed between machines) and then load those presets back in. Specifically it copies the ~/Library/Application\ Support/BetterTouchTool folder.

I have 2 actions:

Shortcut 1) Copy BTT presets to folder - Contains 2 actions:

  1. "Execute Terminal Command (Syncrhonous, blocking)" with command:
    cp -R -f ~/Library/Application\ Support/BetterTouchTool <your backup folder>
  • Note: On Mac destination for 'cp' command must include folder name being copied as in: ~/MyBTTBackup/BetterTouchTool/
  1. "Run Apple Script" which I use just to show a dialog "Saved settings" so I can be sure it ran

** Shortcut 2) Retore BTT presets to folder and Restart BTT - Contains 2 actions:**

  1. "Execute Terminal Command (Syncrhonous, blocking)" with command:
    cp -R -f ~/Library/Application\ Support/BetterTouchTool ~/MyBTTBackup/BetterTouchTool/
  2. "Restart BetterTouchTool" (so the settings are applied)

In testing I found you can't do the same for the preferences file since I think it is saved upon app exit but once they are set I really never need to change them so that's fine.


#7

@Andreas_Hegenberg, I think it would be relatively easy to set up sync with folder and it would work even more cleanly than t he workaround I suggest above. I suggest replacing current Dropbox option with this since it would then work with Dropbox or any other method of sync.

  • At system startup, BTT could look to a folder and, if changed, load new App Support and Preferences files. It could determine if its new by comparing dates between what's in Library and what is in the "sync folder".
  • if app remains open, optionally consider checking for changes every minutes or so
  • If the BTT app (the UI) is launched, check for changes in sync folder and re-load prefs and presets if changed. This would ensure user is not editing out of date presets.
  • After any changes that a user makes to either BTT Prefs or presets, copy files from Library to "Sync folder". Before so, check to see if any changes made and if so give user choice of overwriting or re-loading from sync folder. Assuming you checked for changes when BTT app was loaded, its unlikely user would be editing in BTT app on 2 machines at same time so IMO I don't think its worth getting fancy about handling sync conflicts.

#8

Don't think too much about it, I have already implemented something for syncing via folders.Dropbox sync won't be replaced though as it has some speed & reliability advantages due to the Dropbox API. It will be an additional feature.

However it won't be released until the new UI is out (working hard on it, but no release date yet)