I have a misbehaving app that creates a window that is larger than the screen. So I want to change the startup command, to start the app, wait for it to launch, then resize its window. For example:

guvcview
wmctrl -r GUVCVideo -e 0,600,0,640,512

Both commands work when run individually, but not as a single command line or script. Any ideas?