Created
July 5, 2023 02:25
-
-
Save jjwatt/9dfaa8dfbaa075675f965938e97866f9 to your computer and use it in GitHub Desktop.
This file contains 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
stayawake() { | |
while :; do | |
# If we've been idle for more than $num msecs | |
if [ "$(xprintidle)" -gt 100000 ] | |
then | |
# Randomly move the mouse somewhere on the screen | |
xdotool mousemove "$(( ${RANDOM} % ${screenwidth:-1920} ))" "$(( ${RANDOM} % ${screenheight:-1080} ))" | |
fi | |
sleep 30 | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment