How to disable sleeping on Raspberry pi

I recently installed Raspian Buster with Desktop (circa 2019-September) - the smaller install with the Desktop, but without the "recommended software". I found there are two settings that have to be changed as either one of them will blank the screen in ten minutes under the default settings.
set screen saver timeout to zero:

xset s 0

and set dpms (EnergyStar) to disabled:

xset -dpms

This way I haven't needed to install anything (no screensaver). It was confusing because I'd tried both items, but it wasn't until I learned they both were blanking the screen at ten minutes that I saw what was going on.
As this has tested out OK, the next step for me is to put them into an autostart routine.
ps Verify your settings with

xset q

I installed xscreensaver

  1. sudo apt-get install xscreensaver
  2. Once installed, go to Rpi's desktop "Menu" (left top corner)
  3. Go to preference --> screensaver.
  4. You will see a screen saver main menu. In the mode drop-down menu, select "disable screensaver" then close the window.
  5. Reboot the Raspberry PI.

It should work now.


You don't need to install lib, just edit lightdm

1 - Open lightdm using your prefer text editor, eg using default editor(nano).:

sudo nano /etc/lightdm/lightdm.conf

2 - Add this line

xserver-command=X -s 0 -p 0 -dpms