Disable Screensaver in Raspberry PI

If you want to keep your Raspberry PI running all the time, just follow these few steps:

Edit the file “/etc/lightdm/lightdm.conf“:

sudo vi /etc/lightdm/lightdm.conf

change the code from this:

[SeatDefaults]
#xserver-command=X

to this:

[SeatDefaults]
xserver-command=X -s 0 -dpms

Next edit the file “/etc/xdg/lxsession/LXDE/autostart“:

sudo vi /etc/xdg/lxsession/LXDE/autostart

and comment out the xscreensaver line like so:

@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@xscreensaver -no-splash

Next edit the file “/etc/kbd/config” and change these lines like so:

BLANK_TIME=0
BLANK_DPMS=off
POWERDOWN_TIME=0

Save all the files and reboot for the changes to take effect.