寻找一个非常简单的Bash脚本来自动按键 [英] Looking for a very simple Bash script for automated key press

查看:58
本文介绍了寻找一个非常简单的Bash脚本来自动按键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个非常简单的linux bash脚本,该脚本每60秒模拟一次组合键"ctrl + S",并在后台运行.

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.

不幸的是,我没有关于Bash脚本的任何线索,也找不到相关主题.有人可以帮我吗?

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

谢谢!

推荐答案

在循环中使用xdotool:

Use xdotool in a loop:

while sleep 60
do
  xdotool key ctrl+s
done

这篇关于寻找一个非常简单的Bash脚本来自动按键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆