Tuesday, July 1, 2014

Mouse Wiggler

Have you ever watched a Jootoob movie and got annoyed when the screen saver kicked in?

Some video players interact with the screen savers and will send a dbus command every once in a while to kick the screen saver, but some don't.

The standard fix is to get a child to wiggle the mouse every once in a while.  At least that way they get some exercise!

However, a computer is supposed to automate things, so here is a Linux mouse wiggler script using the xdotool:

# yum install xdotool -y

#! /bin/bash
while [ "${STATUS:-null}" != null ]; do
  STATUS=`pgrep firefox`
  xdotool mousemove_relative 1 1
  sleep 1
  xdotool mousemove_relative -- -1 -1
  sleep 1

It will keep wiggling the mouse pointer a tiny little bit, while Firefox is running.

Modify at your peril...

BTW, there is something similar available for a Mac called Caffeine.

No comments:

Post a Comment

On topic comments are welcome. Junk will be deleted.