Something reasonably close to this will hopefully make it into upstream 1.0.4 release. Let's see if it works well enough.