Okay, this issue is kinda difficult to understand without context:
When we run Evince, it checks if there is any other instance running.
If there is one, the
evincecommand exits immediately, right after passing the parameter to the running instance
If no other instance is running, a new one will be started, and the
evincecommand will wait until this new instance exits.
While that behavior is quite nice, it is not helpful for shell scripts. Why? Because I have a script that writes a temporary
.ps file, calls a PS/PDF viewer, and automatically deletes the temporary
.ps file after the viewer exits. Unfortunately, this script only works if evince was not previously running (if evince was running, then the file is deleted too fast).
I don't want to add extra complexity to this script. It should be kept simple, because I may want to replace evince with xpdf, gv, or anything else.
I was expecting some kind of command-line parameter to evince (similar to
-f to vim and gvim), but I fear there is no such option. Writing a wrapper script around
evince might be a good solution, but this script should work correctly in all cases (if evince was running and if it wasn't).
Any ideas? (I know... this one is quite difficult)