0

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
  • 107,083
  • 22
  • 201
  • 376
Greg Nifor
  • 33
  • 1
  • 5
  • 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

0

Have you tried this?

open-program && send-keyboard-input
Alex Shroyer
  • 3,225
  • 2
  • 26
  • 48