Hello Manjaro community,
A few weeks ago I created a script that has the function of repeatedly sending F12 to a game of mine, even if it’s in the background, let’s call it “GameWar”
The script was assembled as follows
#!/bin/bash
while true;
do sleep $(shuf -i2-5 -n1);
xdotool key --window $(xdotool search --name 'GameWar') F12;
done
The function of sending F12 in an interval between 2s and 5s is working, however, the problems I am facing are the following;
- I would like F12 to be sent to the game, even if it is minimized or in the background, the code above sends F12 , but only if the game is focused/foreground.
What I would like to implement is the following;
- I would like F12 not to be sent when I am pressing any other key or mouse click, is it possible to implement this?