I used xdotool
to automate some actions. It takes data from a spreadsheet, and "types" it into a Web site, instead of me having to manually copy and paste all of that data over, saving hundreds of hours of work. This is running through a simple while loop, and the data extracted using awk
from the spreadsheet.
The problem is, sometimes either while testing out a new xdotool
Bash script, or just in some random cases, xdotool
starts to wreck havoc on things, and it is difficult to stop. I have to switch back to the terminal window, and hit CTRL+C quickly, but in the meantime, it can do some damaging things, such as type in potentially dangerous code in the terminal that mistakenly gets executed. The most serious issues I've actually had is that it takes over and I can't regain control of things.
Is there some way to integrate, perhaps into the Bash script, some kind of "kill switch", perhaps for instance, if I hit a certain key combo on the keyboard, it tells it to immediately stop running?
pkill xdotool
sound like a reasonable solution to your problem? – undercat Aug 23 '19 at 02:09xdotool
. – Village Aug 24 '19 at 03:23