catch signals on X11 systems to ensure clean shutdown