3

I'm running a program (concretely xfoil) and during calculations it opens and closes a window automatically. I would like the pop-up window to keep hidden.

Create control file:

cat <<EOF > controlfile.xfoil NACA 0012 GDES Flap0.8 0.0425 0.1 eXec OPER RE 1388888 MACH0.0561930287789 v ITER 300 ALFA 10 FMOM 0.8 0.0425 QUIT EOF 

Run file from terminal and save output:

xfoil < controlfile.xfoil >outputfile.out 

When running it you'll see briefly a pop-up window.

How can I keep the pop-up window hidden? Luckily the source code of xfoil is available and I could compile a version without the window, but I would prefer not having to.

1
  • I ran into exactly the same problem. Thank you for asking this question! Commented Sep 9, 2020 at 9:56

2 Answers 2

2

It is a bit excessive, but you can start a 2nd X11 server with no framebuffer and direct your display there:

Xvfb :1 & sleep 2 DISPLAY=:1 xfoil <controlfile.xfoil >outputfile.out kill -15 $! 
4
  • Why is sleep 2 necessary? Commented Jun 24, 2016 at 13:59
  • 2 is an arbitrary number, you may need more or less. The problem is you have to wait for Xvfb to run far enough for it to create the socket needed by xfoil to connect to. To avoid all problems you should really run a small loop, doing sleep 1 and then checking if Xvfb is ready, eg with if DISPLAY=:1 xdpyinfo >/dev/null... Commented Jun 24, 2016 at 14:49
  • Is there anything special to consider when using this from a bash script? When I run these commands from the command line, then everything works fine. However, when I put those commands into a script, then I get the error xdpyinfo: unable to open display ":99". Commented Sep 9, 2020 at 10:40
  • @FelixCrazzolara Sorry, I don't know why you are getting that error. Commented Sep 11, 2020 at 17:09
0

There is a top menu in XFoil called plotting options, which you can access with PLOP. Then the command G F for graphic output : false will disable these pop-ups.

So in your program that would be the addition of:

PLOP
G F

At the very beginning. Don't forget the empty line so that you go back to top menu !

1
  • Just to be clear, this only prevents the XFOIL display window itself from opening. On my MacOS computer, it still keeps opening an empty pop-up dock icon (with no XFOIL display). This pop-up steals focus, which is the really annoying thing. The answer by @meuh solves the complete problem, though it's pretty hacky! Commented Jun 10, 2020 at 18:17

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.