I have a zillion machines in different places (home network, cloud, ...) and I use fish
on each of them. The problem is that I have to synchronize their configuration every time I change something in there.
Is there a way to load the configuration from a remote repository? (= a place where it would be stored, not necessarily git
but ideally I would manage them in GitHub). In such a case I would just have a one liner everywhere.
- I do not care too much about startup time, loading the config each time would be acceptable
- I cannot push the configuration to the machines (via Ansible for instance) - not of them are reachable from everywhere directly - but all of them can reach Internet
There are two parts to your question. Part one is not specific to fish. For systems I use on a regular basis I use Dropbox. I put my ~/.config/fish directory in a Dropbox directory and symlink to it. For machines I use infrequently, such as VMs I use for investigating problems unique to a distro, I use rsync to copy from my main desktop machine. For example,
Note the exclusion of the
fishd.*
pattern. That's part two of your question and is unique to fish. Files in your ~/.config/fish directory named with that pattern are the universal variable storage and are currently unique for each machine. We want to change that -- see https://github.com/fish-shell/fish-shell/issues/1912. The problem is that file contains the color theme variables. So to copy your color theme requires exporting those vars on one machine:Then doing
set -U
on the new machine for each line of output from the preceding command. Obviously if you have other universal variables you want synced you should just doset -U
and import all of them.