Skip to content

Instantly share code, notes, and snippets.

@jjwatt
Created July 5, 2023 02:25
Show Gist options
  • Save jjwatt/9dfaa8dfbaa075675f965938e97866f9 to your computer and use it in GitHub Desktop.
Save jjwatt/9dfaa8dfbaa075675f965938e97866f9 to your computer and use it in GitHub Desktop.
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