Just stumbling across this, looks like a solid solution has already been posted but I’ve recently come across another that may be of interest as well: