Skip to content

Instantly share code, notes, and snippets.

@p3x-robot
Last active September 27, 2021 11:44
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 p3x-robot/0a118205aaab82070ed530f45da95138 to your computer and use it in GitHub Desktop.
Save p3x-robot/0a118205aaab82070ed530f45da95138 to your computer and use it in GitHub Desktop.
Move mouse to prevent screensaver from activating locking
#!/bin/bash
# you need to install xdotool:
# sudo apt install -y xdotool
# probably you can find this in every distro, but it only shows the debian based distros install
move=(-1 1 0)
wait=60
while :
do
# x=${move[$RANDOM % ${#move[@]} ]}
# y=${move[$RANDOM % ${#move[@]} ]}
# echo `date` "xdotool mousemove_relative -- $x $y => sleep $wait => Press CTRL+C to exit"
# xdotool mousemove_relative -- $x $y
xdotool mousemove_relative -- 1 0
echo `date` "xdotool mousemove_relative -- 1 0 => sleep $wait => Press CTRL+C to exit"
sleep 1
xdotool mousemove_relative -- -1 0
echo `date` "xdotool mousemove_relative -- -1 0 => sleep $wait => Press CTRL+C to exit"
sleep $wait
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment