Skip to content

Instantly share code, notes, and snippets.

@Lissy93
Created December 16, 2019 10:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Lissy93/0e2af593dae398aee602d5c801189953 to your computer and use it in GitHub Desktop.
Save Lissy93/0e2af593dae398aee602d5c801189953 to your computer and use it in GitHub Desktop.
Quick script to periodically move the mouse. Many uses, such as avoiding Suspend to RAM Timeout, or more realistically keep status set to active while working from home πŸ˜‰
# The mouse pointer will move around its current position on the screen, i.e. around any position
# on the screen where you place the pointer. However, if you prefer it to move around the centre
# of the screen then change mousemove_relative to mousemove in the xdotool command below.
# LENGTH is the amount of px the mouse will move
# 0 = not moving at all, 1 = tiny movement, 100 = giant movement
LENGTH=50
# DELAY os the number of seconds, between movements
DELAY=5
while true
do
for ANGLE in 0 90 180 270
do
xdotool mousemove_relative --polar $ANGLE $LENGTH
sleep $DELAY
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment