Motivation
This is no longer being used. Found way simpler approaches, but if for some reason you still need to sync directories this is a good tool.
At first I was designing a complex multiple remotes git repository to
synch my wsl and windows directories. I know that I can just
cd into the /mnt/c/... directory and work there but
lets just say that for every command that I run while in
the windows side, I have to wait for 5 seconds for the
starship prompt to show up.
But after some research I found out about unison which is a simple tool to synch directories.
Solution
As after testing the tool I found it to be very simple and effective so I decided to use it.
BUG
The file watcher does not work properly on the
windowsmount path, so until I find a solutionunisonhas to be restarted manually for it to detect changes on thewindowsside.
I just had to install it on the wsl side
yay -S unisonAnd run the following command to synch the directories
unison ~/obsidian-vault /mnt/c/Users/pablo/Documents/ObsidianVault \
-auto -repeat=watch -prefer /home/hadronomy/obsidian-vaultThe first two arguments are the directories to synch, the -auto flag
ensures that the changes are propagated automatically, the -repeat=watch
keep the process running and watching for changes and
the -prefer /home/hadronomy/obsidian-vault flag ensures that the conflicts
are resolved by keeping the wsl version.