This topic caught my attention and I was looking into it. I found something quite similar to what you described here: GitHub link.