That makes a lot of sense. Below is such a version; assuming it works okay on Linux it should be good to go.