Last active
September 27, 2021 11:44
-
-
Save p3x-robot/0a118205aaab82070ed530f45da95138 to your computer and use it in GitHub Desktop.
Move mouse to prevent screensaver from activating locking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
https://gist.github.com/devernay/68ea104c8a1322067702127465f3ae2d