I have actually written a shitty & dumb version of exactly this, that works quite well (but not tested much). Might share a link here in the comments if i find time to publish.