Bash读取特定时间段的鼠标事件
我有一个脚本,基本上是这样的:Bash读取特定时间段的鼠标事件,bash,x11,Bash,X11,我有一个脚本,基本上是这样的: while : do sleep 1m some_val=$(python "a.py" 2>&1) if [ $some_val -ge 1 ] then #dosomething fi done 每当鼠标在最后一分钟没有移动或单击时,我想做一些事情。如何在Bash中存档此文件?您可以使用eval$(xdotool getmouselocation--shell)将当前鼠标位置存储在$X和
while :
do
sleep 1m
some_val=$(python "a.py" 2>&1)
if [ $some_val -ge 1 ]
then
#dosomething
fi
done
每当鼠标在最后一分钟没有移动或单击时,我想做一些事情。如何在Bash中存档此文件?您可以使用
eval$(xdotool getmouselocation--shell)
将当前鼠标位置存储在$X和$Y中。如果您只关心用户什么都不做多长时间,您可以使用xprintidle
@ChristophSommerxprintidle
完成此操作。键盘输入对我来说并不是特别重要,但是,它就像一种魅力!