GUI applications executed from a script try to connect to the X server specified by the DISPLAY
variable. If you clear that variable, programs will not be able to open a window, so that should effectively prevent any popups. For example, if you try to run this:
DISPLAY= xterm
You'll get an error like this:
xterm: Xt error: Can't open display:
xterm: DISPLAY is not set
Either you can write DISPLAY=
right in front of the command you want to run like I showed with xterm
above, or you can write DISPLAY=
on its own line somewhere earlier in the script.
However, some programs might not start at all if DISPLAY
is not set.
If that's the case for the program generating the popup,
and if this program does something useful other than the popup,
then you won't be able to use this technique. It's worth a shot anyway.