Move mouse to prevent screensaver from activating & locking (wiggleme)

Automatically move your mouse to keep your screen from locking.

Ubuntu

while :; do
  xdotool mousemove_relative -- 1 0
  sleep 1
  xdotool mousemove_relative -- -1 0
  sleep 60
done

OS X

timeout=$((10 * 60))
while :; do
  last_mouse_position=$(cliclick "p")
 
  sec="${timeout}"
  while [[ $sec -ge 0 ]]; do
    echo -ne "\r$sec\033[0K"
    sec=$((sec-1))
    sleep 1
  done
  echo -ne "\r"
 
  current_mouse_position=$(cliclick "p")
  if [[ $last_mouse_position == $current_mouse_position ]]; then
      cliclick "m:+1,+0"
      cliclick "m:-1,+0"
  fi
done
Did this help you? Please let me know with a comment. Thank you
Posted .

Comments (RSS)

Leave a comment