If anyone has ideas on how to set up automatic flattening on a non-rooted Android phone, I’m all ears. If not, perhaps there is a thing that would be possible with Tasker or some other tool which can run a linux command like:
find "$TARGET" -mindepth 2 -type f -exec mv -n "{}" "$TARGET/" \;
find "$TARGET" -mindepth 1 -type d -empty -delete
Hi @testing123,
I’ve implemented custom script support into the Syncthing-Fork app. The wrapper can now run shell scripts when a folder completes its sync progress. I’m using it myself to clean up mess Android itself repeatedly puts in my folders to prevent it from syncing across to other connected devices.
You can optIn to test it by turning expert options on and upgrading to this test build:
https://github.com/Catfriend1/syncthing-android/actions/runs/15002361443/artifacts/3116423884
For security considerations, you have to put your scripts into “.stfolder” and turn that option explicitly on per folder. See Expert option: Run custom shell script after folder sync completed by Catfriend1 · Pull Request [#1412](https://a.plas.ml/./add-tag/1412) · Catfriend1/syncthing-android · GitHub for more details and demo scripts.