put startup/cleanup code in function, should solve problems with popups which grab wrong windows because of hanging id files in /dev/shm