Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
341 views
in Technique[技术] by (71.8m points)

linux - Looking for a very simple Bash script for automated key press

I would like to write a very simple linux bash script that simulates the key-combination "ctrl+S" every 60 seconds and runs in the background.

Unfortunately I don't have any clue about Bash Scripts and couldn't find related topics. Could someone help me out?

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Use xdotool in a loop:

while sleep 60
do
  xdotool key ctrl+s
done

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...