Something that may work is using TkGui.withdraw() instead of sys.exit() when autoClose is enabled - this should hide the PyLNP window without exiting completely. I'm not sure how well this will work on all platforms, though - the launcher may remain open but invisible after exiting DF.
EDIT: exec* is not an option because utilities need to be launched after DF - so it's necessary to find a way to launch DF as an entirely stand-alone process, with its own terminal window. For Windows, I can use the start command; on OS X, I can use open. I haven't been able to figure out a useful possibility on Linux; I don't see a way to make Python do it directly, and I haven't been able to detect which terminal program the user is using to launch a new one. If anyone knows something I don't, I'm all ears.
Is there a reason for this? I think some utilities (DT?) check for DF on startup, but I don't know of any that exit immediately if DF isn't running (and either way, there's no guarantee which will finish launching first). Admittedly, exec() won't work with DFHack if PyLNP is launched without a terminal window, so it's not a complete solution.
Fake edit:
I tend to think that handling most cases is good enough, so my logic would be:
- if someone wants to use DFHack on Linux, use xdg if that'll work.
- otherwise make them configure it in the config, and don't spend time trying to make the launcher smart enough to help much.
- if they can't do that, no dfhack through the launcher.
I think this would cover most people under the first point, and those not covered are probably able to finish setting that up themselves. And the worst cast is they have to start DF manually to play with DFHack - hardly a disaster.
It's worth mentioning that the current default is to
not close the launcher when launching DF, which doesn't cause any problems with DFHack (until the launcher is closed, that is).