2

Is there a bash command that waits for a window to open? Right now I'm doing something along the lines of:

open-program
sleep 100       # Wait for the program to open
send-keyboard-input

Is there a way to have "send-keyboard-input" wait until open-program finishes, eliminating the sleep 100? The time always varies, sometimes it's 90 seconds, sometimes it's 50 second.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Greg Nifor
  • 53
  • 1
  • 6
  • If you know what the window will be called/etc. you can try using something like `wmctrl` to wait until you can see it (by polling/looping). You can do that manually `xprop` too most likely but it may not be as simple. – Etan Reisner Nov 26 '14 at 17:27

1 Answers1

1

Have you tried this?

open-program && send-keyboard-input
Alex Shroyer
  • 3,499
  • 2
  • 28
  • 54