I had a thought about a simple way to show sync status from a file browser, by just having a script that polls syncthing for sync status of each tracked folder and then creates (ignored) files in the root of each tracked folder, like
some_syncthing_poller | while read -r syncstatus folder; do
case syncstatus of
synced) cp /imgs/st-synced.jpg "$folder/st-status.jpg"
nonsynced) cp /imgs/st-nonsynced.jpg "$folder/st-status.jpg"
esac
done
but I can’t find anything in the rest api that lists all tracked folders (with their local paths). Is there a way to do this kind of thing? (Or would it make sense to have this kind of image-copying as a built-in optional feature of syncthing?)
I think you can do even better on at least Mac and Windows that support setting custom icons for folders. To get the list of folders and paths you can request the current config, which includes that.
Hm, as far as I know there’s no (standard) way to set custom folder icons on Linux :-/
I actually ended up just reading the config.xml to find the folders, since that way I can have a different icon if Syncthing is down:
Seems to work
Now I get a simple .desktop file within the folder linking to the Syncthing GUI, with an icon and name showing the sync state. The script could probably be expanded to create relevant files for other OS’es …