Thank you!
The edit worked. I just had to increase the sleep time to 10, otherwise the link opens in fullscreen and revert to windowed when the connection is made (perhaps this can be adjusted with the wmctrl but I am not familiar with its options).
This feature in the command line will be very usefull.