Preventing the Screensaver from Running in Lubuntu

For some reason, my 2nd Lubuntu machine just won’t play ball when it comes to stopping the screensaver from running. Of course, I’ve tried all the usual stuff and mostly it isn’t a problem, except, that is, when watching films.

At approximately every 10 minutes after no activity, the screensaver comes on but is there anything we can do about it? We could move the mouse or touch a key - that works, but even that is a pain because if you are lying in bed, you don’t really want to get up to do that. And if you don’t quite make it in time…grrrr…password time. There is a better way; an automated way:

Step 1: Install xautomation

> sudo apt-get install xautomation

Step 2: Type this into your terminal

> while true; do xte 'mousermove 1,0'; sleep 600; done

Let’s break that down a little to explain what’s happening.

Firstly, we’re running a loop which will never end: while true. True is always true, so it will always execute. Next, we run the mousermove command of xte. You can find out more about xte by typing “man xte”, but basically, we’re asking the mouse to move one pixel to the right. Then we sleep for 600 seconds, which is 10 minutes and finally, end the loop. You can easily change how long it sleeps for and to be honest, at 600, I notice a flicker which I wouldn’t if I just set it to be something slightly smaller.

Hope that helps and happy film watching!


Hi! Did you find this useful or interesting? I have an email list coming soon, but in the meantime, if you ready anything you fancy chatting about, I would love to hear from you. You can contact me here or at stephen ‘at’ logicalmoon.com