Depending entirely on the definedness/value of DISPLAY is absolutely the right thing to do. Any scheme to detect the presence of an X server on the process host is wrong, because there is no guarantee that the user running the application is sitting at the console of the process host. (I know this from painful experience. :-) In general, she won't be, although of course statistically it may be likely.
This seems to be the solution on which the best informed contributors to the thread agree, so I will stick with it, except that since I will have two versions in any case, namely a CLI one and a GUI one, I will still exec() the CLI one if running some minimal Tk code in an eval() block fails.
| [reply] |