TOOLS: add script for emulating "unique application" functionality on Linux

See github issue #43.

This comes with a load of caveats, so be sure to read the comments at
the start of the script.