In Ubuntu 20.04, I am trying to write a very small script to bring a specified window to the foreground and then send a key combination on this window.
For that I am using:
#!/bin/bash
xdotool search --onlyvisible --class <myWindow> windowactivate %@
xdotool key ctrl+alt+p
Now, while the specified window in <myWindow>
is indeed coming to the foreground, the key combination seems to not have any effect, no error showed or anything like that. However, it does have the desired effect if I send the combination manually with the keyboard and with the window in the foreground.
I also tried adding a little delay sleep 2
between the 2 commands, no luck so far.
Missing something here?