Skip to content

Instantly share code, notes, and snippets.

@satishgumudavelli
Created April 3, 2021 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save satishgumudavelli/69e721c3db0af0b04e4de277b74cf080 to your computer and use it in GitHub Desktop.
Save satishgumudavelli/69e721c3db0af0b04e4de277b74cf080 to your computer and use it in GitHub Desktop.
#requires:
# 'xprintidle' for inactivity check (in ms)
# 'rand' for generating random number (screen resolution)
# 'xdotool' to move the mouse pointer
#parameters:
# 100000 idle time in ms before executing the mousemove
# 800 / 600: your screen resolution, at at least the moving range for the mouse pointer
while :; do
if [ $(xprintidle) -gt 2000 ]
then
xdotool mousemove `rand -M 800` `rand -M 600`;
fi
sleep 2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment