graceful closing of programs through wmctrl