I am running a bash script which executes a command that pops-up an annoying GUI dialog (I execute it multiple times inside the script). This pop-up disrupts whatever I am doing in the UI while running the script in the background.


Is there any way to hide these?

  • 1
    Some more details, like which command is executed etc., would help.
    – dirkt
    Mar 23, 2017 at 21:53
  • It's a c++ binary from this open source project. My bad, I just found a quiet option in the Wiki section for the command line argument. Mar 24, 2017 at 11:46

1 Answer 1


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.

  • Indeed, the program refuses to start in this case. Mar 24, 2017 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.