Synchronizing FreeTube settings across computers
FreeTube is fantastic, and since it started including support for SponsorBlock, it has become my main way of consuming YouTube content. The only downside being the fact that there is no built-in way to synchronize your setup across computers. By the power of open source, let's fix it!
Ingredients
- Two or more computers
- Software that syncs files from your filesystem (I use Syncthing)
- Symbolic links
If you have a sync solution already set up, syncing your settings is quite simple. FreeTube has a directory that contains all its settings, which can be added to your chosen sync software, then linked into the correct locations. In my case, I wanted sync from the Linux Flatpak version of the app that runs on my personal computer, to my MacBook, and to my work computer which runs Windows. It's also important to note that Syncthing does not follow symbolic links (to avoid infinite recursion issues), so the actual FreeTube settings folder needs to live in your Syncthing directory - then linked out - not the other way around. If your chosen syncing solution syncs directories in-place, then just point it at the correct locations.
- Linux Flatpak settings directory:
~/.var/app/io.freetubeapp.FreeTube/config/FreeTube - macOS settings directory:
~/Library/Application Support/FreeTube - Windows settings directory:
%appdata%\FreeTube
Simply sync the FreeTube directory, then use a symbolic link to place it in the correct locations:
- Linux:
ln -s /path/to/synced/FreeTube/dir ~/.var/app/io.freetubeapp.FreeTube/config/FreeTube - macOS:
ln -s /path/to/synced/FreeTube/dir "~/Library/Application Support/FreeTube" - Windows:
mklink /D %appdata%\FreeTube C:\path\to\synced\FreeTube
This will synchronize all FreeTube settings, watch history and subscriptions across all linked computers.
Note that the operands are flipped between Linux/macOS ln and Windows mklink; *nix ln uses target link_name while Windows mklink uses link_name target (which is great fun when you do this relatively often and always mess up the order).
After some testing with this, I also recommend adding these files to the Syncthing ignore list on each synced client (.stignore in the root of the Syncthing directory):
Cache_Data
SingletonCookie
SingletonLock
SingletonSocket
lockfile
These are session lock and cache files used by FreeTube that will cause sync errors if they are not ignored. Since they are ignored, though, I recommend always cleanly closing FreeTube on each computer after you're done using it - using it on more than one computer at the same time WILL cause sync conflicts.
Giving Flatpak permissions to access the new settings location
As Hum correctly points out in the comments, you also need to give FreeTube access to the new path if its running as a Flatpak. I've accomplished this by giving it the filesystem=host permission via Flatseal, a Flatpak permissions manager GUI.
Hum said:
Just something to note, you eed to give the flatpak freetube permission to access the new location if it is not in its path.
lars said:
Thanks for pointing that out, @Hum! I had already given FreeTube that permission system-wide earlier and didn't remember to include it in the post - I've updated the post to include this information :)
Rodric said:
No need to give FreeTube access to your whole filesystem. In Flatseal’s “Filesystem” section just add your synced FreeTube path to the “Other files” section. Alternatively, you can avoid messing with symlinks and filesystem access entirely by syncing the ~/.var/app/io.freetubeapp.FreeTube/config/FreeTube directory in Syncthing directly.
lars said:
@Rodric, that's a valid approach for sure. I use symlinks and a Syncthing directory named "Synced settings" because I do this with several applications and games to sync their settings across computers, and it ensures that uninstalls won't wipe any data (if any synced directory is
rm'ed by the host, it'll just delete the symlink and not the contents)ddawn said:
hi! thank you for providing this guide. there seems to be no one else that has provided a guide for freetube and syncthing, i'm very grateful.
although, i've followed your method and in the folder i created for freetube in syncthing, it has 0 data in it. i'm stumped!!
i followed @Rodric 's method for Flatseal's Other Files section and added the ~/.var/app/io.freetubeapp.FreeTube/config/FreeTube directory, but to no avail.
any help would be appreciated, thank you!!